]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Fri, 7 Feb 2014 00:04:28 +0000 (00:04 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Fri, 7 Feb 2014 00:04:28 +0000 (00:04 +0000)
coders/txt.c

index 93d3b4306b6490c41672616d3e1c64a631977454..47696dbc218a4581322393d09b85936eb2347628 100644 (file)
@@ -421,10 +421,13 @@ static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception)
     return(ReadTEXTImage(image_info,image,text,exception));
   do
   {
+    width=0;
+    height=0;
+    max_value=0;
     *colorspace='\0';
     count=(ssize_t) sscanf(text+32,"%lu,%lu,%lu,%s",&width,&height,&max_value,
       colorspace);
-    if (count != 4)
+    if ((count != 4) || (width == 0) || (height == 0) || (max_value == 0))
       ThrowReaderException(CorruptImageError,"ImproperImageHeader");
     image->columns=width;
     image->rows=height;