summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-10-15 11:17:52 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2022-10-15 11:17:52 -0400
commitffdc64bea210836e6e08352a81c049f4b969ce88 (patch)
treef54b89e8d950d74a4eb40fa7497776c818cb2399
parentf3d679aefe7539620d1c494a156245fe8c6d7192 (diff)
downloadrockbox-ffdc64bea2.tar.gz
rockbox-ffdc64bea2.zip
skin_engine fix invalid buflib handle checks
buflib considers handles <= 0 as invalid skin engine was using handles < 0 Change-Id: Ie156223a43039d48ef4846fe31e6191630fa7c04
-rw-r--r--apps/gui/skin_engine/skin_parser.c3
-rw-r--r--apps/gui/skin_engine/wps_internals.h2
2 files changed, 2 insertions, 3 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index bd9a202ec7..047c4735a0 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -1830,7 +1830,6 @@ abort:
wps_data->font_ids = PTRTOSKINOFFSET(skin_buffer, NULL); /* Safe if skin_buffer is NULL */
wps_data->images = PTRTOSKINOFFSET(skin_buffer, NULL);
wps_data->buflib_handle = core_free(wps_data->buflib_handle);
- wps_data->buflib_handle = -1;
#endif
}
@@ -1998,7 +1997,7 @@ static bool load_skin_bitmaps(struct wps_data *wps_data, char *bmpdir)
strcpy(path, img->bm.data);
handle = load_skin_bmp(wps_data, &img->bm, bmpdir);
img->buflib_handle = handle;
- img->loaded = img->buflib_handle >= 0;
+ img->loaded = img->buflib_handle > 0;
if (img->loaded)
{
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h
index bf368bc4f3..c220480f13 100644
--- a/apps/gui/skin_engine/wps_internals.h
+++ b/apps/gui/skin_engine/wps_internals.h
@@ -372,7 +372,7 @@ struct wps_data
#ifndef __PCTOOL__
static inline char* get_skin_buffer(struct wps_data* data)
{
- if (data->buflib_handle >= 0)
+ if (data->buflib_handle > 0)
return core_get_data(data->buflib_handle);
return NULL;
}