GIF loader: Fix for libgif version 5.

This commit is contained in:
Kim Woelders 2013-08-04 08:05:27 +02:00
parent 31af56a040
commit 1df8defbaa
1 changed files with 7 additions and 0 deletions

View File

@ -29,6 +29,7 @@ load(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity,
/* already data in this image - dont load it again */
if (im->data)
return 0;
#ifndef __EMX__
fd = open(im->real_file, O_RDONLY);
#else
@ -36,12 +37,18 @@ load(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity,
#endif
if (fd < 0)
return 0;
#if GIFLIB_MAJOR >= 5
gif = DGifOpenFileHandle(fd, NULL);
#else
gif = DGifOpenFileHandle(fd);
#endif
if (!gif)
{
close(fd);
return 0;
}
do
{
if (DGifGetRecordType(gif, &rec) == GIF_ERROR)