* image.c (tiff_load): Fix off-by-one image count (Bug#8336).
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 24 Mar 2011 07:36:32 +0000 (00:36 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 24 Mar 2011 07:36:32 +0000 (00:36 -0700)
src/ChangeLog
src/image.c

index cdde967..998e201 100644 (file)
@@ -1,5 +1,7 @@
 2011-03-24  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
+
        * xselect.c (x_check_property_data): Return correct size (Bug#8335).
 
 2011-03-23  Paul Eggert  <eggert@cs.ucla.edu>
index 7584f9b..695ac14 100644 (file)
@@ -6754,7 +6754,7 @@ tiff_load (struct frame *f, struct image *img)
   TIFF *tiff;
   int width, height, x, y, count;
   uint32 *buf;
-  int rc, rc2;
+  int rc;
   XImagePtr ximg;
   tiff_memory_source memsrc;
   Lisp_Object image;
@@ -6842,8 +6842,8 @@ tiff_load (struct frame *f, struct image *img)
   rc = fn_TIFFReadRGBAImage (tiff, width, height, buf, 0);
 
   /* Count the number of images in the file.  */
-  for (count = 1, rc2 = 1; rc2; count++)
-    rc2 = fn_TIFFSetDirectory (tiff, count);
+  for (count = 1; fn_TIFFSetDirectory (tiff, count); count++)
+    continue;
 
   if (count > 1)
     img->data.lisp_val = Fcons (Qcount,