Skip to content

Commit

Permalink
reject invalid BMP image @ ImageMagick/ImageMagick#6393
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Jun 7, 2023
1 parent 2934d51 commit 55cc408
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions coders/bmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,8 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
/*
Microsoft Windows BMP image file.
*/
if (bmp_info.size < 40)
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
bmp_info.width=(ssize_t) ReadBlobLSBSignedLong(image);
bmp_info.height=(ssize_t) ReadBlobLSBSignedLong(image);
bmp_info.planes=ReadBlobLSBShort(image);
Expand Down

0 comments on commit 55cc408

Please sign in to comment.