We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cab00b6 commit 2130bf6Copy full SHA for 2130bf6
coders/wpg.c
@@ -1050,7 +1050,9 @@ static Image *ReadWPGImage(const ImageInfo *image_info,
1050
WPG_Palette.StartIndex=ReadBlobLSBShort(image);
1051
WPG_Palette.NumOfEntries=ReadBlobLSBShort(image);
1052
if ((WPG_Palette.NumOfEntries-WPG_Palette.StartIndex) >
1053
- (Rec2.RecordLength-2-2) / 3)
+ (Rec2.RecordLength-2-2)/3)
1054
+ ThrowReaderException(CorruptImageError,"InvalidColormapIndex");
1055
+ if (WPG_Palette.StartIndex > WPG_Palette.NumOfEntries)
1056
ThrowReaderException(CorruptImageError,"InvalidColormapIndex");
1057
image->colors=WPG_Palette.NumOfEntries;
1058
if (!AcquireImageColormap(image,image->colors,exception))
0 commit comments