Fix segfault when Flatfield blur radius == 0

This commit is contained in:
heckflosse 2016-06-12 20:56:55 +02:00
parent 4a1fb9ae4a
commit c11465e46a

View File

@ -3042,10 +3042,17 @@ void RawImageSource::copyOriginalPixels(const RAWParams &raw, RawImage *src, Raw
SSEFUNCTION void RawImageSource::cfaboxblur(RawImage *riFlatFile, float* cfablur, const int boxH, const int boxW)
{
if(boxW == 0 && boxH == 0) { // nothing to blur
memcpy(cfablur, riFlatFile->data[0], W*H*sizeof(float));
return;
}
float *tmpBuffer = nullptr;
float *cfatmp = nullptr;
float *srcVertical = nullptr;
if(boxH > 0 && boxW > 0) {
// we need a temporary buffer if we have to blur both directions
tmpBuffer = (float (*)) calloc (H * W, sizeof * tmpBuffer);
@ -3065,7 +3072,6 @@ SSEFUNCTION void RawImageSource::cfaboxblur(RawImage *riFlatFile, float* cfablur
srcVertical = cfatmp;
}
#ifdef _OPENMP
#pragma omp parallel
#endif