From 36e48a8bb262a0e85f5c43f54d12ef617708c0a5 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Mon, 2 Aug 2021 23:06:40 -0400 Subject: icon.c guard against negative error values bytesread is copied to an unsigned int for core_shrink Change-Id: Iff93397e7d6fae8936ef0fdbb1e71df63bcf6531 --- apps/gui/icon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/gui') 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, ic->handle_locked = 0; /* 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) ic->handle = core_free(ic->handle); -- cgit v1.2.3