summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'desktop')
-rw-r--r--desktop/bitmap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/desktop/bitmap.c b/desktop/bitmap.c
index b191043bf..acbd22e41 100644
--- a/desktop/bitmap.c
+++ b/desktop/bitmap.c
@@ -106,7 +106,8 @@ static const char *bitmap__layout_to_str(enum bitmap_layout layout)
[BITMAP_LAYOUT_ABGR8888] = "0xAABBGGRR (native endian)",
};
- if (layout >= (sizeof(str)) / sizeof(*str)) {
+ if ((size_t)layout >= (sizeof(str)) / sizeof(*str) ||
+ str[layout] == NULL) {
return "Unknown";
}