mirror of
https://github.com/GerbilSoft/rom-properties.git
synced 2025-06-18 11:35:38 -04:00
[librptexture] ICOPrivate::loadImage_Win3(): Move the bitmap size check up a bit.
Some checks failed
Codecov / run (push) Has been cancelled
Some checks failed
Codecov / run (push) Has been cancelled
This commit is contained in:
parent
417825cd6f
commit
e12bb51b47
@ -597,14 +597,15 @@ rp_image_const_ptr ICOPrivate::loadImage_Win3(void)
|
||||
// NOTE: Negative height is allowed for "right-side up".
|
||||
const unsigned int width = le32_to_cpu((unsigned int)(bih->biWidth));
|
||||
const int orig_height = static_cast<int>(le32_to_cpu(bih->biHeight));
|
||||
const bool is_upside_down = (orig_height > 0);
|
||||
const unsigned int height = abs(orig_height);
|
||||
const unsigned int half_height = height / 2;
|
||||
if (width <= 0 || height == 0 || (height & 1)) {
|
||||
// Invalid bitmap size.
|
||||
return {};
|
||||
}
|
||||
|
||||
const bool is_upside_down = (orig_height > 0);
|
||||
const unsigned int half_height = height / 2;
|
||||
|
||||
// Only supporting 16-color images for now.
|
||||
// TODO: Handle BI_BITFIELDS?
|
||||
if (le32_to_cpu(bih->biPlanes) > 1) {
|
||||
|
Loading…
Reference in New Issue
Block a user