summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-09 20:47:50 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-09 20:47:50 (GMT)
commit36c93a9f34c55e8117000c15c5217df1846a6006 (patch)
tree61b2bea3674dd94c7ef7f1d3be96a0c6abd76e3a
parentbf3040dd58e253d5fbb7afe932e9a49c92ec21e4 (diff)
Watch out for negative boundary values
-rw-r--r--kstars/fitsviewer/fitsdata.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/kstars/fitsviewer/fitsdata.cpp b/kstars/fitsviewer/fitsdata.cpp
index 96b3a76..3dc0dd3 100644
--- a/kstars/fitsviewer/fitsdata.cpp
+++ b/kstars/fitsviewer/fitsdata.cpp
@@ -725,8 +725,8 @@ 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 subY = boundary.isNull() ? 0 : boundary.y();
+ int subX = qMax(0, boundary.isNull() ? 0 : boundary.x());
+ int subY = qMax(0, boundary.isNull() ? 0 : boundary.y());
int subW = (boundary.isNull() ? data->getWidth() : boundary.width());
int subH = (boundary.isNull() ? data->getHeight(): boundary.height());