Skip to content

Display and control your Android device

Check surface returned for icon

Romain Vimont2dc1a594714d
diff --git a/app/src/tiny_xpm.c b/app/src/tiny_xpm.c
index 01fd280f..0fb410f3 100644
--- a/app/src/tiny_xpm.c
+++ b/app/src/tiny_xpm.c
@@ -105,6 +105,10 @@ read_xpm(char *xpm[]) {
width, height,
32, 4 * width,
rmask, gmask, bmask, amask);
+ if (!surface) {
+ LOGE("Could not create icon surface");
+ return NULL;
+ }
// make the surface own the raw pixels
surface->flags &= ~SDL_PREALLOC;
return surface;