]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - filter/image-gif.c
Import CUPS 1.4svn-r7226.
[thirdparty/cups.git] / filter / image-gif.c
index df8e81e4d21d13f61d645a502e7861593e726920..a391811fcdbcb5de451e671ab1496f911e334f38 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   GIF image routines for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 2007 by Apple Inc.
+ *   Copyright 2007-2008 by Apple Inc.
  *   Copyright 1993-2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -462,8 +462,14 @@ gif_read_image(FILE         *fp,   /* I - Input file */
   pass      = 0;
   code_size = getc(fp);
 
+  if (!pixels)
+    return (-1);
+
   if (gif_read_lzw(fp, 1, code_size) < 0)
+  {
+    free(pixels);
     return (-1);
+  }
 
   temp = pixels;
   while ((pixel = gif_read_lzw(fp, 0, code_size)) >= 0)