Skip to content
Permalink
Browse files

http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=26857

  • Loading branch information...
cristy
cristy committed Jan 10, 2015
1 parent 1530816 commit b8f17d08b7418204bf8a05a5c24e87b2fc395b75
Showing with 3 additions and 3 deletions.
  1. +3 −3 coders/sun.c
@@ -409,8 +409,8 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception)
sun_info.length || !sun_info.length)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
number_pixels=(MagickSizeType) image->columns*image->rows;
if ((sun_info.type != RT_ENCODED) && (sun_info.depth >= 8) &&
((number_pixels*((sun_info.depth+7)/8)) > sun_info.length))
if ((sun_info.type != RT_ENCODED) &&
((number_pixels*sun_info.depth) > (8*sun_info.length)))
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
bytes_per_line=sun_info.width*sun_info.depth;
sun_data=(unsigned char *) AcquireQuantumMemory((size_t) MagickMax(
@@ -532,7 +532,7 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception)
bytes_per_pixel++;
if (bytes_per_line == 0)
bytes_per_line=bytes_per_pixel*image->columns;
length=image->rows*(bytes_per_line+image->columns % 2);
length=image->rows*(bytes_per_line+bytes_per_line % 2);
if (((sun_info.type == RT_ENCODED) &&
(length > (bytes_per_line*image->rows))) ||
((sun_info.type != RT_ENCODED) && (length > sun_info.length)))

0 comments on commit b8f17d0

Please sign in to comment.
You can’t perform that action at this time.