From 15b74274943800abc1e0348a6d37a6acca853ac3 Mon Sep 17 00:00:00 2001 From: obache Date: Sun, 25 May 2014 09:18:06 +0000 Subject: Fixes error handling bug introduced in patch for glflib-5.0.4. --- x11/xplanet/distinfo | 4 +-- x11/xplanet/patches/patch-src_libimage_gif.c | 49 ++++++++++++++++++---------- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/x11/xplanet/distinfo b/x11/xplanet/distinfo index 6f7f249d5d6..3ce5cd8870a 100644 --- a/x11/xplanet/distinfo +++ b/x11/xplanet/distinfo @@ -1,6 +1,6 @@ -$NetBSD: distinfo,v 1.18 2014/05/16 09:57:55 wiz Exp $ +$NetBSD: distinfo,v 1.19 2014/05/25 09:18:06 obache Exp $ SHA1 (xplanet-1.2.2.tar.gz) = 3c9cc4be7cd87121884162204eff376af2fc03e3 RMD160 (xplanet-1.2.2.tar.gz) = 431c9223b2b122599a8c4bdca18c17fea0dcd5ab Size (xplanet-1.2.2.tar.gz) = 1217169 bytes -SHA1 (patch-src_libimage_gif.c) = a5c869d5cfe319e62a6e963ffc2b48a8cc754357 +SHA1 (patch-src_libimage_gif.c) = 6c107bd1f733fe82f2b88af8ad778e0fe5aea5bd diff --git a/x11/xplanet/patches/patch-src_libimage_gif.c b/x11/xplanet/patches/patch-src_libimage_gif.c index 7339de98f95..43032b8f811 100644 --- a/x11/xplanet/patches/patch-src_libimage_gif.c +++ b/x11/xplanet/patches/patch-src_libimage_gif.c @@ -1,10 +1,10 @@ -$NetBSD: patch-src_libimage_gif.c,v 1.2 2014/05/16 09:57:55 wiz Exp $ +$NetBSD: patch-src_libimage_gif.c,v 1.3 2014/05/25 09:18:06 obache Exp $ * Fix build with giflib 5.1. --- src/libimage/gif.c.orig 2006-03-25 22:50:51.000000000 +0000 +++ src/libimage/gif.c -@@ -21,8 +21,27 @@ +@@ -21,8 +21,26 @@ #include #include @@ -17,7 +17,6 @@ $NetBSD: patch-src_libimage_gif.c,v 1.2 2014/05/16 09:57:55 wiz Exp $ #include +/* from util/qprintf.c of giflib 5.0.4 */ -+int ErrorCode; +void +PrintGifError(int ErrorCode) +{ @@ -32,7 +31,13 @@ $NetBSD: patch-src_libimage_gif.c,v 1.2 2014/05/16 09:57:55 wiz Exp $ /* A lot of this is based on the gif2rgb and rgb2gif codes in the libungif distribution. -@@ -42,11 +61,11 @@ read_gif(const char *filename, int *widt +@@ -37,16 +55,17 @@ read_gif(const char *filename, int *widt + GifFileType *infile; + GifRecordType record_type; + GifRowType *buffer = NULL; ++ int ErrorCode; + + int i, j; int color_index; unsigned char *ptr = NULL; @@ -51,7 +56,7 @@ $NetBSD: patch-src_libimage_gif.c,v 1.2 2014/05/16 09:57:55 wiz Exp $ if (DGifGetRecordType(infile, &record_type) == GIF_ERROR) { - PrintGifError(); -+ PrintGifError(ErrorCode); ++ PrintGifError(infile->Error); return(0); } @@ -60,7 +65,7 @@ $NetBSD: patch-src_libimage_gif.c,v 1.2 2014/05/16 09:57:55 wiz Exp $ if (DGifGetImageDesc(infile) == GIF_ERROR) { - PrintGifError(); -+ PrintGifError(ErrorCode); ++ PrintGifError(infile->Error); return(0); } @@ -69,7 +74,7 @@ $NetBSD: patch-src_libimage_gif.c,v 1.2 2014/05/16 09:57:55 wiz Exp $ if (DGifGetExtension(infile, &ext_code, &ext) == GIF_ERROR) { - PrintGifError(); -+ PrintGifError(ErrorCode); ++ PrintGifError(infile->Error); return(0); } while (ext != NULL) @@ -77,7 +82,7 @@ $NetBSD: patch-src_libimage_gif.c,v 1.2 2014/05/16 09:57:55 wiz Exp $ if (DGifGetExtensionNext(infile, &ext) == GIF_ERROR) { - PrintGifError(); -+ PrintGifError(ErrorCode); ++ PrintGifError(infile->Error); return(0); } } @@ -90,7 +95,15 @@ $NetBSD: patch-src_libimage_gif.c,v 1.2 2014/05/16 09:57:55 wiz Exp $ return(1); } -@@ -178,7 +197,7 @@ write_gif(const char *filename, int widt +@@ -166,6 +185,7 @@ write_gif(const char *filename, int widt + GifByteType *red, *green, *blue, *buffer, *ptr; + GifFileType *outfile; + ColorMapObject *colormap; ++ int ErrorCode; + + red = malloc(width * height * sizeof(GifByteType)); + green = malloc(width * height * sizeof(GifByteType)); +@@ -178,7 +198,7 @@ write_gif(const char *filename, int widt return(0); } @@ -99,7 +112,7 @@ $NetBSD: patch-src_libimage_gif.c,v 1.2 2014/05/16 09:57:55 wiz Exp $ for (i = 0; i < width * height; i++) { -@@ -187,10 +206,10 @@ write_gif(const char *filename, int widt +@@ -187,10 +207,10 @@ write_gif(const char *filename, int widt blue[i] = (GifByteType) rgb[3*i+2]; } @@ -108,11 +121,11 @@ $NetBSD: patch-src_libimage_gif.c,v 1.2 2014/05/16 09:57:55 wiz Exp $ buffer, colormap->Colors) == GIF_ERROR) { - PrintGifError(); -+ PrintGifError(ErrorCode); ++ PrintGifError(-1); return(0); } -@@ -198,24 +217,24 @@ write_gif(const char *filename, int widt +@@ -198,24 +218,24 @@ write_gif(const char *filename, int widt free(green); free(blue); @@ -129,7 +142,7 @@ $NetBSD: patch-src_libimage_gif.c,v 1.2 2014/05/16 09:57:55 wiz Exp $ == GIF_ERROR) { - PrintGifError(); -+ PrintGifError(ErrorCode); ++ PrintGifError(outfile->Error); return(0); } @@ -137,27 +150,27 @@ $NetBSD: patch-src_libimage_gif.c,v 1.2 2014/05/16 09:57:55 wiz Exp $ == GIF_ERROR) { - PrintGifError(); -+ PrintGifError(ErrorCode); ++ PrintGifError(outfile->Error); return(0); } -@@ -224,7 +243,7 @@ write_gif(const char *filename, int widt +@@ -224,7 +244,7 @@ write_gif(const char *filename, int widt { if (EGifPutLine(outfile, ptr, width) == GIF_ERROR) { - PrintGifError(); -+ PrintGifError(ErrorCode); ++ PrintGifError(outfile->Error); return(0); } ptr += width; -@@ -232,8 +251,8 @@ write_gif(const char *filename, int widt +@@ -232,8 +252,8 @@ write_gif(const char *filename, int widt EGifSpew(outfile); - if (EGifCloseFile(outfile) == GIF_ERROR) - PrintGifError(); + if (EGifCloseFile(outfile, NULL) == GIF_ERROR) -+ PrintGifError(ErrorCode); ++ PrintGifError(outfile->Error); free(buffer); -- cgit v1.2.3