Buffer underrun in RGB denoise, Issue 2337. Could also fix 'Crash when creating detail window, Issue 2324' (Thanks to Hombre)
This commit is contained in:
parent
51e80b8c03
commit
832c8b6c25
@ -298,8 +298,8 @@ namespace rtengine {
|
|||||||
dstLo[(pitch*(i))] = 0.5*(srcbuffer[i] + srcbuffer[i+skip]);
|
dstLo[(pitch*(i))] = 0.5*(srcbuffer[i] + srcbuffer[i+skip]);
|
||||||
dstHi[(pitch*(i))] = 0.5*(srcbuffer[i] - srcbuffer[i+skip]);
|
dstHi[(pitch*(i))] = 0.5*(srcbuffer[i] - srcbuffer[i+skip]);
|
||||||
}
|
}
|
||||||
|
// Start the loop at max(srclen-skip,skip) to avoid buffer underrun
|
||||||
for(size_t i = (srclen-skip); i < (srclen); i++) {
|
for(size_t i = max(srclen-skip,skip); i < (srclen); i++) {
|
||||||
dstLo[(pitch*(i))] = 0.5*(srcbuffer[i] + srcbuffer[i-skip]);
|
dstLo[(pitch*(i))] = 0.5*(srcbuffer[i] + srcbuffer[i-skip]);
|
||||||
dstHi[(pitch*(i))] = 0.5*(srcbuffer[i] - srcbuffer[i-skip]);
|
dstHi[(pitch*(i))] = 0.5*(srcbuffer[i] - srcbuffer[i-skip]);
|
||||||
}
|
}
|
||||||
|
@ -108,11 +108,14 @@ CropWindow::CropWindow (ImageArea* parent, rtengine::StagedImageProcessor* ipc_,
|
|||||||
|
|
||||||
cropHandler.setCropHandlerListener (this);
|
cropHandler.setCropHandlerListener (this);
|
||||||
cropHandler.newImage (ipc_);
|
cropHandler.newImage (ipc_);
|
||||||
cropHandler.setEnabled (true);
|
|
||||||
|
|
||||||
state = SNormal;
|
state = SNormal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CropWindow::enable() {
|
||||||
|
cropHandler.setEnabled (true);
|
||||||
|
}
|
||||||
|
|
||||||
void CropWindow::setPosition (int x, int y) {
|
void CropWindow::setPosition (int x, int y) {
|
||||||
|
|
||||||
if (y<0)
|
if (y<0)
|
||||||
|
@ -120,6 +120,7 @@ class CropWindow : public LWButtonListener, public CropHandlerListener, public E
|
|||||||
void getPosition (int& x, int& y);
|
void getPosition (int& x, int& y);
|
||||||
void setSize (int w, int h, bool norefresh=false);
|
void setSize (int w, int h, bool norefresh=false);
|
||||||
void getSize (int& w, int& h);
|
void getSize (int& w, int& h);
|
||||||
|
void enable ();
|
||||||
|
|
||||||
void leaveNotify (GdkEventCrossing* event);
|
void leaveNotify (GdkEventCrossing* event);
|
||||||
void flawnOver (bool isFlawnOver);
|
void flawnOver (bool isFlawnOver);
|
||||||
|
@ -93,6 +93,7 @@ void ImageArea::on_resized (Gtk::Allocation& req) {
|
|||||||
mainCropWindow->setPointerMotionHListener (pmhlistener);
|
mainCropWindow->setPointerMotionHListener (pmhlistener);
|
||||||
mainCropWindow->setPosition (0, 0);
|
mainCropWindow->setPosition (0, 0);
|
||||||
mainCropWindow->setSize (get_width(), get_height(), false); // this execute the refresh itself
|
mainCropWindow->setSize (get_width(), get_height(), false); // this execute the refresh itself
|
||||||
|
mainCropWindow->enable(); // start processing !
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mainCropWindow->setSize (get_width(), get_height());
|
mainCropWindow->setSize (get_width(), get_height());
|
||||||
@ -386,6 +387,9 @@ void ImageArea::addCropWindow () {
|
|||||||
cw->setPosition (lastClosedX, lastClosedY);
|
cw->setPosition (lastClosedX, lastClosedY);
|
||||||
lastClosedX = -1;
|
lastClosedX = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cw->enable(); // start processing!
|
||||||
|
|
||||||
int x0,y0,w,h,wc,hc;
|
int x0,y0,w,h,wc,hc;
|
||||||
mainCropWindow->getCropRectangle(x0,y0,w,h );
|
mainCropWindow->getCropRectangle(x0,y0,w,h );
|
||||||
cw->getCropSize(wc,hc);
|
cw->getCropSize(wc,hc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user