--- a/src/modules/loaders/loader_gif.c +++ b/src/modules/loaders/loader_gif.c @@ -60,13 +60,21 @@ h = gif->Image.Height; if (!IMAGE_DIMENSIONS_OK(w, h)) { - DGifCloseFile(gif); + #if GIFLIB_MAJOR > 5 || (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_MAJOR == 5 && GIFLIB_MINOR >= 1) + DGifCloseFile(gif, NULL); + #else + DGifCloseFile(gif); + #endif return 0; } for (i = 0; i < h; i++) @@ -78,7 +86,11 @@ rows[i] = malloc(w * sizeof(GifPixelType)); if (!rows[i]) { - DGifCloseFile(gif); + #if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) + DGifCloseFile(gif, NULL); + #else + DGifCloseFile(gif); + #endif for (i = 0; i < h; i++) { if (rows[i]) @@ -150,7 +162,11 @@ im->data = (DATA32 *) malloc(sizeof(DATA32) * w * h); if (!im->data) { - DGifCloseFile(gif); + #if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) + DGifCloseFile(gif, NULL); + #else + DGifCloseFile(gif); + #endif free(rows); return 0; } @@ -181,7 +197,11 @@ last_per = (int)per; if (!(progress(im, (int)per, 0, last_y, w, i))) { - DGifCloseFile(gif); + #if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) + DGifCloseFile(gif, NULL); + #else + DGifCloseFile(gif); + #endif for (i = 0; i < h; i++) { free(rows[i]); @@ -198,7 +218,11 @@ { progress(im, 100, 0, last_y, w, h); } - DGifCloseFile(gif); + #if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) + DGifCloseFile(gif, NULL); + #else + DGifCloseFile(gif); + #endif for (i = 0; i < h; i++) { free(rows[i]);