Skip to content

Commit

Permalink
Fix a potential stack overflow bug with GIF images.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Dec 22, 2021
1 parent 753c71b commit e4a335e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -2,6 +2,7 @@

- BMP image support is now deprecated and will be removed in a future
release of HTMLDOC.
- Fixed a potential stack overflow bug with GIF images.
- Fixed the PDF creation date (Issue #455)
- Fixed a potential stack overflow bug with BMP images (Issue #456)
- Fixed a compile issue when libpng was not available (Issue #458)
Expand Down
2 changes: 1 addition & 1 deletion htmldoc/image.cxx
Expand Up @@ -311,7 +311,7 @@ gif_read_image(FILE *fp, /* I - Input file */

temp = img->pixels;

while ((pixel = gif_read_lzw(fp, 0, code_size)) >= 0)
while ((pixel = gif_read_lzw(fp, 0, code_size)) >= 0 && pixel < 256)
{
temp[0] = cmap[pixel][0];

Expand Down

0 comments on commit e4a335e

Please sign in to comment.