Fix loader cleanup breakage (gif)

This commit is contained in:
Kim Woelders 2019-12-29 15:27:03 +01:00
parent f4ab8e10b1
commit 495527a74e
1 changed files with 13 additions and 9 deletions

View File

@ -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);