--- imlib2-1.4.6.old/src/modules/loaders/loader_gif.c +++ imlib2-1.4.6/src/modules/loaders/loader_gif.c @@ -36,7 +36,12 @@ #endif if (fd < 0) return 0; - gif = DGifOpenFileHandle(fd); +#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1 + gif = DGifOpenFileHandle (fd, NULL); +#else + gif = DGifOpenFileHandle (fd); +#endif + if (!gif) { close(fd); @@ -60,13 +65,21 @@ h = gif->Image.Height; if (!IMAGE_DIMENSIONS_OK(w, h)) { - DGifCloseFile(gif); +#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1 + DGifCloseFile (gif,NULL); +#else + DGifCloseFile (gif); +#endif return 0; } rows = malloc(h * sizeof(GifRowType *)); if (!rows) { - DGifCloseFile(gif); +#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1 + DGifCloseFile (gif,NULL); +#else + DGifCloseFile (gif); +#endif return 0; } for (i = 0; i < h; i++) @@ -78,7 +91,11 @@ rows[i] = malloc(w * sizeof(GifPixelType)); if (!rows[i]) { - DGifCloseFile(gif); +#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1 + DGifCloseFile (gif,NULL); +#else + DGifCloseFile (gif); +#endif for (i = 0; i < h; i++) { if (rows[i]) @@ -150,7 +167,11 @@ im->data = (DATA32 *) malloc(sizeof(DATA32) * w * h); if (!im->data) { - DGifCloseFile(gif); +#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1 + DGifCloseFile (gif,NULL); +#else + DGifCloseFile (gif); +#endif free(rows); return 0; } @@ -181,7 +202,11 @@ last_per = (int)per; if (!(progress(im, (int)per, 0, last_y, w, i))) { - DGifCloseFile(gif); +#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1 + DGifCloseFile (gif,NULL); +#else + DGifCloseFile (gif); +#endif for (i = 0; i < h; i++) { free(rows[i]); @@ -198,7 +223,13 @@ { progress(im, 100, 0, last_y, w, h); } - DGifCloseFile(gif); + +#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1 + DGifCloseFile (gif,NULL); +#else + DGifCloseFile (gif); +#endif + for (i = 0; i < h; i++) { free(rows[i]);