Fixed crash on browsing corrupted RAW files
on behalf of Evgeny Andreeshchev; see issue 871
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user