Skip to content

Commit

Permalink
check for corrupt DJVU images (https://github.com/ImageMagick/ImageMa…
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Dec 14, 2023
1 parent d438d68 commit e76a9d6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions coders/djvu.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,8 @@ static Image *ReadOneDJVUImage(LoadContext* lc,const int pagenum,
if (tag == 0) break;
} while (!ddjvu_page_decoding_done(lc->page));

if (ddjvu_page_decoding_error(lc->page) != 0)
ThrowReaderException(CorruptImageError,"CorruptImage");
ddjvu_document_get_pageinfo(lc->document, pagenum, &info);

image->x_resolution = (float) info.dpi;
Expand Down

0 comments on commit e76a9d6

Please sign in to comment.