Commit 40e073c6 authored by Milian Wolff's avatar Milian Wolff

Fix compile with giflib-5.1.0 and upwards.

See news about the giflib-5.1.0 release about the API break here:
http://fossies.org/linux/giflib/NEWS

REVIEW: 118811

(cherry picked from commit 7c7a4757)
parent 6896d876
......@@ -52,6 +52,16 @@ extern "C" {
// #define DEBUG_GIFLOADER
static void closeGif(GifFileType* file)
{
#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)
int errorCode;
DGifCloseFile(file, &errorCode);
#else
DGifCloseFile(file);
#endif
}
namespace khtmlImLoad {
static int INTERLACED_OFFSET[] = { 0, 4, 2, 1 };
......@@ -369,7 +379,7 @@ public:
if (DGifSlurp(file) == GIF_ERROR)
{
DGifCloseFile(file);
closeGif(file);
return Error;
}
......@@ -378,7 +388,7 @@ public:
if (file->ImageCount > 1) {
// Verify it..
if (!ImageManager::isAcceptableSize(file->SWidth, file->SHeight)) {
DGifCloseFile(file);
closeGif(file);
return Error;
}
notifyImageInfo(file->SWidth, file->SHeight);
......@@ -390,7 +400,7 @@ public:
//Extract colormap, geometry, so that we can create the frame
SavedImage* curFrame = &file->SavedImages[frame];
if (!ImageManager::isAcceptableSize(curFrame->ImageDesc.Width, curFrame->ImageDesc.Height)) {
DGifCloseFile(file);
closeGif(file);
return Error;
}
}
......@@ -576,7 +586,7 @@ public:
frame0->animProvider = new GIFAnimProvider(frame0, image, frameProps, bgColor);
}
DGifCloseFile(file);
closeGif(file);
return Done;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment