kwo pushed a commit to branch master.

http://git.enlightenment.org/legacy/imlib2.git/commit/?id=495527a74ef6ed9f9f23e683568de4f0cb6c8f3f

commit 495527a74ef6ed9f9f23e683568de4f0cb6c8f3f
Author: Kim Woelders <[email protected]>
Date:   Sun Dec 29 15:27:03 2019 +0100

    Fix loader cleanup breakage (gif)
---
 src/modules/loaders/loader_gif.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/modules/loaders/loader_gif.c b/src/modules/loaders/loader_gif.c
index 1332d8c..fece782 100644
--- a/src/modules/loaders/loader_gif.c
+++ b/src/modules/loaders/loader_gif.c
@@ -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);

-- 


Reply via email to