Commit 3f1a97f3 authored by Jasem Mutlaq's avatar Jasem Mutlaq

Fixing possible crash conditions

parent 0d90558b
......@@ -434,7 +434,8 @@ void Capture::newFITS(IBLOB *bp)
SequenceJob *job = jobs.at(jobIndex);
executeJob(job);
if (job)
executeJob(job);
}
}
......@@ -463,6 +464,9 @@ void Capture::captureImage()
targetChip = activeJob->activeChip;
if (targetChip == NULL)
return;
if (targetChip->setFrame(activeJob->x, activeJob->y, activeJob->w, activeJob->h) == false)
{
appendLogText(i18n("Failed to set sub frame."));
......
......@@ -707,6 +707,10 @@ void FITSImage::findCentroid(int initStdDev, int minEdgeWidth)
cen_x = (int) round(rCenter->x);
cen_y = (int) round(rCenter->y);
if (cen_x < 0 || cen_x > stats.dim[0] || cen_y < 0 || cen_y > stats.dim[1])
continue;
// Complete sum along the radius
//for (int k=0; k < rCenter->width; k++)
for (int k=rCenter->width/2; k >= -(rCenter->width/2) ; k--)
......
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