Skip to content

Commit e04cf3e

Browse files
author
Cristy
committed
https://github.com/ImageMagick/ImageMagick/issues/851
1 parent de87676 commit e04cf3e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: coders/wpg.c

+2
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,8 @@ static Image *ReadWPGImage(const ImageInfo *image_info,
10631063
if ((WPG_Palette.NumOfEntries-WPG_Palette.StartIndex) >
10641064
(Rec2.RecordLength-2-2) / 3)
10651065
ThrowReaderException(CorruptImageError,"InvalidColormapIndex");
1066+
if (WPG_Palette.StartIndex > WPG_Palette.NumOfEntries)
1067+
ThrowReaderException(CorruptImageError,"InvalidColormapIndex");
10661068
image->colors=WPG_Palette.NumOfEntries;
10671069
if (!AcquireImageColormap(image,image->colors))
10681070
goto NoMemory;

0 commit comments

Comments
 (0)