Commit 36c93a9f authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Watch out for negative boundary values

parent bf3040dd
...@@ -725,8 +725,8 @@ int FITSData::findCannyStar(FITSData *data, const QRect &boundary) ...@@ -725,8 +725,8 @@ int FITSData::findCannyStar(FITSData *data, const QRect &boundary)
template<typename T> int FITSData::findCannyStar(FITSData *data, const QRect &boundary) template<typename T> int FITSData::findCannyStar(FITSData *data, const QRect &boundary)
{ {
int subX = boundary.isNull() ? 0 : boundary.x(); int subX = qMax(0, boundary.isNull() ? 0 : boundary.x());
int subY = boundary.isNull() ? 0 : boundary.y(); int subY = qMax(0, boundary.isNull() ? 0 : boundary.y());
int subW = (boundary.isNull() ? data->getWidth() : boundary.width()); int subW = (boundary.isNull() ? data->getWidth() : boundary.width());
int subH = (boundary.isNull() ? data->getHeight(): boundary.height()); int subH = (boundary.isNull() ? data->getHeight(): boundary.height());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment