mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
icon.c guard against negative error values bytesread is copied to an unsigned int for core_shrink
Change-Id: Iff93397e7d6fae8936ef0fdbb1e71df63bcf6531
This commit is contained in:
parent
93c9d675af
commit
36e48a8bb2
1 changed files with 1 additions and 1 deletions
|
@ -205,7 +205,7 @@ static void load_icons(const char* filename, enum Iconset iconset,
|
||||||
ic->handle_locked = 0;
|
ic->handle_locked = 0;
|
||||||
|
|
||||||
/* free unused alpha channel, if any */
|
/* free unused alpha channel, if any */
|
||||||
core_shrink(ic->handle, ic->bmp.data, size_read);
|
core_shrink(ic->handle, ic->bmp.data, size_read > 0 ? size_read : 0);
|
||||||
|
|
||||||
if (size_read <= 0)
|
if (size_read <= 0)
|
||||||
ic->handle = core_free(ic->handle);
|
ic->handle = core_free(ic->handle);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue