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;
|
return 200;
|
||||||
|
|
||||||
if (setjmp (failure)) {
|
if (setjmp (failure)) {
|
||||||
if (image)
|
if (image) { free (image); image=NULL; }
|
||||||
free (image);
|
fclose(ifp); ifp=NULL;
|
||||||
fclose (ifp);
|
|
||||||
return 100;
|
return 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,10 +199,11 @@ int RawImage::loadRaw (bool loadData, bool closeFile)
|
|||||||
cblack[c] -= i;
|
cblack[c] -= i;
|
||||||
black += i;
|
black += i;
|
||||||
}
|
}
|
||||||
if( closeFile ){
|
|
||||||
fclose(ifp);
|
if ( closeFile ) {
|
||||||
ifp=NULL;
|
fclose(ifp); ifp=NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user