openbsd-ports/multimedia/ming/patches/patch-util_gif2dbl_c
2015-03-29 10:50:24 +00:00

39 lines
963 B
Plaintext

$OpenBSD: patch-util_gif2dbl_c,v 1.2 2015/03/29 10:50:24 sthen Exp $
support giflib 5.0+, from http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/multimedia/ming/patches/
--- util/gif2dbl.c.orig Sat Jun 8 15:08:51 2013
+++ util/gif2dbl.c Sun Mar 29 11:49:57 2015
@@ -19,10 +19,12 @@
#include "libming.h"
+int ErrorCode;
+
void error(char *msg)
{
printf("%s:\n\n", msg);
- PrintGifError();
+ PrintGifError(ErrorCode);
exit(-1);
}
@@ -59,7 +61,7 @@ unsigned char *readGif(char *fileName, int *length, in
unsigned char *p;
int i, nColors, size, alpha, bgColor, alignedWidth;
- if((file = DGifOpenFileName(fileName)) == NULL)
+ if((file = DGifOpenFileName(fileName, &ErrorCode)) == NULL)
error("Error opening file");
if(DGifSlurp(file) != GIF_OK)
@@ -190,7 +192,7 @@ unsigned char *readGif(char *fileName, int *length, in
}
/* Done! */
- DGifCloseFile(file);
+ DGifCloseFile(file, NULL);
*length = size;
return data;