File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -351,7 +351,10 @@ static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception)
351351 {
352352 c = XBMInteger (image ,hex_digits );
353353 if (c < 0 )
354- break ;
354+ {
355+ data = (unsigned char * ) RelinquishMagickMemory (data );
356+ ThrowReaderException (CorruptImageError ,"ImproperImageHeader" );
357+ }
355358 * p ++ = (unsigned char ) c ;
356359 if ((padding == 0 ) || (((i + 2 ) % bytes_per_line ) != 0 ))
357360 * p ++ = (unsigned char ) (c >> 8 );
@@ -361,7 +364,10 @@ static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception)
361364 {
362365 c = XBMInteger (image ,hex_digits );
363366 if (c < 0 )
364- break ;
367+ {
368+ data = (unsigned char * ) RelinquishMagickMemory (data );
369+ ThrowReaderException (CorruptImageError ,"ImproperImageHeader" );
370+ }
365371 * p ++ = (unsigned char ) c ;
366372 }
367373 if (EOFBlob (image ) != MagickFalse )
You can’t perform that action at this time.
0 commit comments