forked from old/legacy-imlib2
Fix loader cleanup breakage (gif)
This commit is contained in:
parent
f4ab8e10b1
commit
495527a74e
|
@ -27,19 +27,18 @@ load(ImlibImage * im, ImlibProgressFunction progress,
|
|||
if (fd < 0)
|
||||
return LOAD_FAIL;
|
||||
|
||||
rc = LOAD_FAIL;
|
||||
done = 0;
|
||||
rows = NULL;
|
||||
transp = -1;
|
||||
|
||||
#if GIFLIB_MAJOR >= 5
|
||||
gif = DGifOpenFileHandle(fd, NULL);
|
||||
#else
|
||||
gif = DGifOpenFileHandle(fd);
|
||||
#endif
|
||||
close(fd);
|
||||
if (!gif)
|
||||
return LOAD_FAIL;
|
||||
|
||||
rc = LOAD_FAIL;
|
||||
done = 0;
|
||||
rows = NULL;
|
||||
transp = -1;
|
||||
goto quit;
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -185,11 +184,16 @@ load(ImlibImage * im, ImlibProgressFunction progress,
|
|||
free(rows);
|
||||
}
|
||||
|
||||
if (gif)
|
||||
{
|
||||
#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)
|
||||
DGifCloseFile(gif, NULL);
|
||||
DGifCloseFile(gif, NULL);
|
||||
#else
|
||||
DGifCloseFile(gif);
|
||||
DGifCloseFile(gif);
|
||||
#endif
|
||||
}
|
||||
|
||||
close(fd);
|
||||
|
||||
if (rc <= 0)
|
||||
__imlib_FreeData(im);
|
||||
|
|
Loading…
Reference in New Issue