src/java.desktop/share/native/libsplashscreen/splashscreen_gif.c

Print this page

        

@@ -294,19 +294,28 @@
     }
 
     free(pBitmapBits);
     free(pOldBitmapBits);
 
-    DGifCloseFile(gif, NULL);
+#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)
+    if (DGifCloseFile(gif, NULL) == GIF_ERROR)
+        return 0;
+#else
+    DGifCloseFile(gif);
+#endif
 
     return 1;
 }
 
 int
 SplashDecodeGifStream(Splash * splash, SplashStream * stream)
 {
+#if GIFLIB_MAJOR >= 5
     GifFileType *gif = DGifOpen((void *) stream, SplashStreamGifInputFunc, NULL);
+#else
+    GifFileType *gif = DGifOpen((void *) stream, SplashStreamGifInputFunc);
+#endif
 
     if (!gif)
         return 0;
     return SplashDecodeGif(splash, gif);
 }