From 9d663cba1abed1697dce5f73a7177ad2d7beaeb7 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 11 Apr 2019 15:54:09 +0200 Subject: [PATCH] Fix libgd warnings --- ext/gd/libgd/gd.c | 6 ++++-- ext/gd/libgd/gd_gif_in.c | 2 +- ext/gd/libgd/gd_wbmp.c | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 3e3b359666..32de38f6c3 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -1990,7 +1990,8 @@ void gdImageFill(gdImagePtr im, int x, int y, int nc) if (x>x2+1) { FILL_PUSH(y, x2+1, x-1, -dy); } -skip: for (x++; x<=x2 && (gdImageGetPixel(im, x, y)!=oc); x++); +skip: + for (x++; x<=x2 && (gdImageGetPixel(im, x, y)!=oc); x++); l = x; } while (x<=x2); @@ -2062,7 +2063,8 @@ static void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc) if (x>x2+1) { FILL_PUSH(y, x2+1, x-1, -dy); } -skip: for(x++; x<=x2 && (pts[y][x] || gdImageGetPixel(im,x, y)!=oc); x++); +skip: + for(x++; x<=x2 && (pts[y][x] || gdImageGetPixel(im,x, y)!=oc); x++); l = x; } while (x<=x2); } diff --git a/ext/gd/libgd/gd_gif_in.c b/ext/gd/libgd/gd_gif_in.c index f78e7f3fb0..ee987e8199 100644 --- a/ext/gd/libgd/gd_gif_in.c +++ b/ext/gd/libgd/gd_gif_in.c @@ -467,7 +467,7 @@ LWZReadByte_(gdIOCtx *fd, LZW_STATIC_DATA *sd, char flag, int input_code_size, i if (sd->sp > sd->stack) return *--sd->sp; - while ((code = GetCode(fd, &sd->scd, sd->code_size, FALSE, ZeroDataBlockP)) >= 0) { + while ((code = GetCode(fd, &sd->scd, sd->code_size, FALSE, ZeroDataBlockP)) >= 0) { if (code == sd->clear_code) { for (i = 0; i < sd->clear_code; ++i) { sd->table[0][i] = 0; diff --git a/ext/gd/libgd/gd_wbmp.c b/ext/gd/libgd/gd_wbmp.c index fd9edad2ca..13dc9e38d6 100644 --- a/ext/gd/libgd/gd_wbmp.c +++ b/ext/gd/libgd/gd_wbmp.c @@ -127,8 +127,11 @@ static int _gdImageWBMPCtx(gdImagePtr image, int fg, gdIOCtx *out) gd_error("Could not save WBMP"); return 1; } + /* des submitted this bugfix: gdFree the memory. */ freewbmp(wbmp); + + return 0; } /* gdImageCreateFromWBMPCtx -- 2.40.0