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 (#3948)

fix #3947: runtime error: signed integer overflow in file
src/bmp.imageio/bmpinput.cpp:302
  • Loading branch information
xiaoxiaoafeifei authored and lgritz committed Aug 20, 2023
1 parent c90efcf commit 672ed4c
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 @@ -297,7 +297,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 672ed4c

Please sign in to comment.