Skip to content

Commit

Permalink
https://github.com/ImageMagick/ImageMagick/issues/851
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Nov 4, 2017
1 parent de87676 commit e04cf3e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions coders/wpg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,8 @@ static Image *ReadWPGImage(const ImageInfo *image_info,
if ((WPG_Palette.NumOfEntries-WPG_Palette.StartIndex) >
(Rec2.RecordLength-2-2) / 3)
ThrowReaderException(CorruptImageError,"InvalidColormapIndex");
if (WPG_Palette.StartIndex > WPG_Palette.NumOfEntries)
ThrowReaderException(CorruptImageError,"InvalidColormapIndex");
image->colors=WPG_Palette.NumOfEntries;
if (!AcquireImageColormap(image,image->colors))
goto NoMemory;
Expand Down

0 comments on commit e04cf3e

Please sign in to comment.