Fix segfault when Flatfield blur radius == 0
This commit is contained in:
parent
4a1fb9ae4a
commit
c11465e46a
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user