diff --git a/CHANGES.md b/CHANGES.md index 5479b28e..02343860 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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) diff --git a/htmldoc/image.cxx b/htmldoc/image.cxx index 0e240888..98c8698e 100644 --- a/htmldoc/image.cxx +++ b/htmldoc/image.cxx @@ -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];