summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2021-08-02 23:06:40 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2021-08-02 23:06:40 -0400
commit36e48a8bb262a0e85f5c43f54d12ef617708c0a5 (patch)
treec34f81712c635f6cee753d0c1d8663b43ecbbc0c /apps/gui
parent93c9d675afaecc13ef51945d0992037e55b98724 (diff)
downloadrockbox-36e48a8bb262a0e85f5c43f54d12ef617708c0a5.tar.gz
rockbox-36e48a8bb262a0e85f5c43f54d12ef617708c0a5.zip
icon.c guard against negative error values bytesread is copied to an unsigned int for core_shrink
Change-Id: Iff93397e7d6fae8936ef0fdbb1e71df63bcf6531
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/icon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/gui/icon.c b/apps/gui/icon.c
index 25c0b372fa..46126e830b 100644
--- a/apps/gui/icon.c
+++ b/apps/gui/icon.c
@@ -205,7 +205,7 @@ static void load_icons(const char* filename, enum Iconset iconset,
205 ic->handle_locked = 0; 205 ic->handle_locked = 0;
206 206
207 /* free unused alpha channel, if any */ 207 /* free unused alpha channel, if any */
208 core_shrink(ic->handle, ic->bmp.data, size_read); 208 core_shrink(ic->handle, ic->bmp.data, size_read > 0 ? size_read : 0);
209 209
210 if (size_read <= 0) 210 if (size_read <= 0)
211 ic->handle = core_free(ic->handle); 211 ic->handle = core_free(ic->handle);