From 687b3fe103096ee37963e4005de1f083bcae5c43 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Mon, 20 Mar 2017 21:07:30 +0100 Subject: [PATCH] segfault on RAF files from Fuji S5 pro, fixes #3741 --- rtengine/rawimagesource.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 4370befbb..df14ddcb2 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -704,6 +704,14 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima imheight = maximheight; } + if (fuji) { // zero image to avoid access to uninitialized values in further processing because fuji super-ccd processing is not clean... + for (int i = 0; i < image->getHeight(); ++i) { + for (int j = 0; j < image->getWidth(); ++j) { + image->r(i, j) = image->g(i, j) = image->b(i, j) = 0; + } + } + } + int maxx = this->W, maxy = this->H, skip = pp.getSkip(); // raw clip levels after white balance