From f3b4722e4f3ae0adf2476e2af0c9f659d960a2c4 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Mon, 28 Aug 2017 17:40:05 +0200 Subject: [PATCH] RawTherapee is crashing when trying to open .dng taken on smartphone, fixes #4047 --- rtengine/rawimage.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rtengine/rawimage.h b/rtengine/rawimage.h index 62752b59c..c2cdcb6ec 100644 --- a/rtengine/rawimage.h +++ b/rtengine/rawimage.h @@ -20,6 +20,8 @@ #define __RAWIMAGE_H #include +#include +#include #include "dcraw.h" #include "imageio.h" @@ -233,7 +235,13 @@ public: } float get_pre_mul(int c )const { - return pre_mul[c]; + if(std::isfinite(pre_mul[c])) { + return pre_mul[c]; + } else { + std::cout << "Failure decoding '" << filename << "', please file a bug report including the raw file and the line below:" << std::endl; + std::cout << "rawimage.h get_pre_mul() : pre_mul[" << c << "] value " << pre_mul[c] << " automatically replaced by value 1.0" << std::endl; + return 1.f; + } } float get_rgb_cam( int r, int c) const {