Skip to content

Commit

Permalink
fix(bmp): fix signed integer overflow when computing total number of …
Browse files Browse the repository at this point in the history
…pixels (AcademySoftwareFoundation#3948)

fix AcademySoftwareFoundation#3947: runtime error: signed integer overflow in file
src/bmp.imageio/bmpinput.cpp:302
  • Loading branch information
xiaoxiaoafeifei authored Aug 20, 2023
1 parent c7f8169 commit 15750af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bmp.imageio/bmpinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ BmpInput::read_rle_image()
int rletype = m_dib_header.compression == RLE4_COMPRESSION ? 4 : 8;
m_spec.attribute("compression", rletype == 4 ? "rle4" : "rle8");
m_uncompressed.clear();
m_uncompressed.resize(m_spec.height * m_spec.width);
m_uncompressed.resize(m_spec.image_pixels());
// Note: the clear+resize zeroes out the buffer
bool ok = true;
int y = 0, x = 0;
Expand Down

0 comments on commit 15750af

Please sign in to comment.