Commits

pajoye  committed 109d5c4

- #87, MFB: fix segfault when an invalid color index is present in the
image data

  • Participants
  • Parent commits 7227885
  • Branches GD-2.0

Comments (0)

Files changed (1)

File src/gd_gif_in.c

        /*} */
 
        while ((v = LWZReadByte(fd, &sd, FALSE, c, ZeroDataBlockP)) >= 0 ) {
+               if (v >= gdMaxColors) {
+                       v = 0;
+               }
+
                /* This how we recognize which colors are actually used. */
                if (im->open[v]) {
                        im->open[v] = 0;