From 5ffcab561963e799f33e8ae3fec6faac948825a5 Mon Sep 17 00:00:00 2001 From: cristy Date: Sat, 12 Sep 2009 02:36:50 +0000 Subject: [PATCH] --- ChangeLog | 1 + ImageMagick.spec | 2 +- coders/gray.c | 19 ++++++++++++------- coders/rgb.c | 6 ------ coders/ycbcr.c | 6 ------ config/configure.xml | 2 +- libtool | 2 +- magick/version.h | 2 +- version.sh | 2 +- 9 files changed, 18 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 10b4c1bee..3fb5917d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2009-09-11 6.5.5-10 Cristy * Return the global maximum threads to avoid the rare cache view assertions. + * Throw an end-of-file exception for truncated raw gray images. 2009-09-10 6.5.5-9 Cristy * Do not include last line of text in the interline spacing computation. diff --git a/ImageMagick.spec b/ImageMagick.spec index 78be29a36..7d810897c 100644 --- a/ImageMagick.spec +++ b/ImageMagick.spec @@ -1,5 +1,5 @@ %define VERSION 6.5.5 -%define Patchlevel 9 +%define Patchlevel 10 Name: ImageMagick Version: %{VERSION} diff --git a/coders/gray.c b/coders/gray.c index 8802d2df2..9b7535bcd 100644 --- a/coders/gray.c +++ b/coders/gray.c @@ -197,7 +197,11 @@ static Image *ReadGRAYImage(const ImageInfo *image_info, length=GetQuantumExtent(canvas_image,quantum_info,quantum_type); count=ReadBlob(image,length,pixels); if (count != (ssize_t) length) - break; + { + ThrowFileException(exception,CorruptImageError, + "UnexpectedEndOfFile",image->filename); + break; + } } for (y=0; y < (long) image->extract_info.height; y++) { @@ -218,6 +222,13 @@ static Image *ReadGRAYImage(const ImageInfo *image_info, if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse) break; count=ReadBlob(image,length,pixels); + if ((count != (ssize_t) length) && + (y < (long) (image->extract_info.height-1))) + { + ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", + image->filename); + break; + } if (((y-image->extract_info.y) >= 0) && ((y-image->extract_info.y) < (long) image->rows)) { @@ -246,12 +257,6 @@ static Image *ReadGRAYImage(const ImageInfo *image_info, } } SetQuantumImageType(image,quantum_type); - if (EOFBlob(image) != MagickFalse) - { - ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", - image->filename); - break; - } /* Proceed to next image. */ diff --git a/coders/rgb.c b/coders/rgb.c index a9fcce5c5..8dfef3845 100644 --- a/coders/rgb.c +++ b/coders/rgb.c @@ -560,12 +560,6 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception) } } SetQuantumImageType(image,quantum_type); - if (EOFBlob(image) != MagickFalse) - { - ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", - image->filename); - break; - } /* Proceed to next image. */ diff --git a/coders/ycbcr.c b/coders/ycbcr.c index 52ec55e6d..14c87c94a 100644 --- a/coders/ycbcr.c +++ b/coders/ycbcr.c @@ -787,12 +787,6 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, } } SetQuantumImageType(image,quantum_type); - if (EOFBlob(image) != MagickFalse) - { - ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", - image->filename); - break; - } /* Proceed to next image. */ diff --git a/config/configure.xml b/config/configure.xml index 5ce21c4a1..d804ab890 100644 --- a/config/configure.xml +++ b/config/configure.xml @@ -8,7 +8,7 @@ - + diff --git a/libtool b/libtool index 4d9e86bf8..99779d85c 100755 --- a/libtool +++ b/libtool @@ -1,7 +1,7 @@ #! /bin/sh # libtool - Provide generalized library-building support services. -# Generated automatically by config.status (ImageMagick) 6.5.5-9 +# Generated automatically by config.status (ImageMagick) 6.5.5-10 # Libtool was configured on host magick.imagemagick.org: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # diff --git a/magick/version.h b/magick/version.h index 4d6fe0d8a..2e9e8fa7f 100644 --- a/magick/version.h +++ b/magick/version.h @@ -30,7 +30,7 @@ extern "C" { #define MagickLibVersion 0x655 #define MagickLibVersionText "6.5.5" #define MagickLibVersionNumber 2,0,0 -#define MagickLibSubversion "-9" +#define MagickLibSubversion "-10" #define MagickReleaseDate "2009-09-11" #define MagickChangeDate "20090911" #define MagickAuthoritativeURL "http://www.imagemagick.org" diff --git a/version.sh b/version.sh index 71b49dd17..6c00462ef 100644 --- a/version.sh +++ b/version.sh @@ -12,7 +12,7 @@ PACKAGE_NAME='ImageMagick' # PACKAGE_NAME (e.g. "1.0.0"). PACKAGE_VERSION='6.5.5' PACKAGE_LIB_VERSION="0x655" -PACKAGE_RELEASE="9" +PACKAGE_RELEASE="10" PACKAGE_LIB_VERSION_NUMBER="6,5,5,${PACKAGE_RELEASE}" PACKAGE_RELEASE_DATE=`date +%F` PACKAGE_STRING="$PACKAGE_NAME $PACKAGE_VERSION" -- 2.40.0