cvs: gd /libgd gd_gif_in.c

[email protected] ("Pierre-Alain Joye")
Newsgroups php.gd.cvs
Message-ID <cvspajoye1181280218@cvsserver>
pajoye		Fri Jun  8 05:23:38 2007 UTC

  Modified files:              
    /gd/libgd	gd_gif_in.c 
  Log:
  - #87, MFB: fix segfault when an invalid color index is present in the
    image data
  
  
http://cvs.php.net/viewvc.cgi/gd/libgd/gd_gif_in.c?r1=1.8&r2=1.9&diff_format=u
Index: gd/libgd/gd_gif_in.c
diff -u gd/libgd/gd_gif_in.c:1.8 gd/libgd/gd_gif_in.c:1.9
--- gd/libgd/gd_gif_in.c:1.8	Sun May  6 19:53:05 2007
+++ gd/libgd/gd_gif_in.c	Fri Jun  8 05:23:38 2007
@@ -564,6 +564,10 @@
        /*} */
 
        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;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.