From 71683ee04b7216f3e5dc579ffbbf819571b73b0d Mon Sep 17 00:00:00 2001 From: Oliver Duis Date: Fri, 29 Jul 2011 08:07:33 +0200 Subject: [PATCH] Fixed crash on browsing corrupted RAW files on behalf of Evgeny Andreeshchev; see issue 871 --- rtengine/rawimage.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rtengine/rawimage.cc b/rtengine/rawimage.cc index 53594942d..24c8eae6c 100644 --- a/rtengine/rawimage.cc +++ b/rtengine/rawimage.cc @@ -174,9 +174,8 @@ int RawImage::loadRaw (bool loadData, bool closeFile) return 200; if (setjmp (failure)) { - if (image) - free (image); - fclose (ifp); + if (image) { free (image); image=NULL; } + fclose(ifp); ifp=NULL; return 100; } @@ -200,10 +199,11 @@ int RawImage::loadRaw (bool loadData, bool closeFile) cblack[c] -= i; black += i; } - if( closeFile ){ - fclose(ifp); - ifp=NULL; + + if ( closeFile ) { + fclose(ifp); ifp=NULL; } + return 0; }