From 03d0a10961746346940115a5ff1779f4e7a455f7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 24 Mar 2011 00:36:32 -0700 Subject: [PATCH] * image.c (tiff_load): Fix off-by-one image count (Bug#8336). --- src/ChangeLog | 2 ++ src/image.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index cdde9673fbd..998e2014c69 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2011-03-24 Paul Eggert + * 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 diff --git a/src/image.c b/src/image.c index 7584f9bb2c0..695ac143fde 100644 --- a/src/image.c +++ b/src/image.c @@ -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, -- 2.39.5