Skip to content

Commit 2130bf6

Browse files
author
Cristy
committed
https://github.com/ImageMagick/ImageMagick/issues/85
1 parent cab00b6 commit 2130bf6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: coders/wpg.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,9 @@ static Image *ReadWPGImage(const ImageInfo *image_info,
10501050
WPG_Palette.StartIndex=ReadBlobLSBShort(image);
10511051
WPG_Palette.NumOfEntries=ReadBlobLSBShort(image);
10521052
if ((WPG_Palette.NumOfEntries-WPG_Palette.StartIndex) >
1053-
(Rec2.RecordLength-2-2) / 3)
1053+
(Rec2.RecordLength-2-2)/3)
1054+
ThrowReaderException(CorruptImageError,"InvalidColormapIndex");
1055+
if (WPG_Palette.StartIndex > WPG_Palette.NumOfEntries)
10541056
ThrowReaderException(CorruptImageError,"InvalidColormapIndex");
10551057
image->colors=WPG_Palette.NumOfEntries;
10561058
if (!AcquireImageColormap(image,image->colors,exception))

0 commit comments

Comments
 (0)