]> granicus.if.org Git - php/commitdiff
Fix libgd warnings
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 11 Apr 2019 13:54:09 +0000 (15:54 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 11 Apr 2019 13:54:09 +0000 (15:54 +0200)
ext/gd/libgd/gd.c
ext/gd/libgd/gd_gif_in.c
ext/gd/libgd/gd_wbmp.c

index 3e3b359666d6a048bc0a52b4ad23022cab5f5b67..32de38f6c31bbe5ea47298dd438e9d23ac4e722a 100644 (file)
@@ -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);
        }
index f78e7f3fb0fceb4858f411322118ea12a0386728..ee987e8199f2a43a004b00e0f5081fc2492c4171 100644 (file)
@@ -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;
index fd9edad2cafa85a2641d61c5e1b1ebc54f4c348f..13dc9e38d6186744f4a9de0039f65d8e87d02614 100644 (file)
@@ -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