From 700c0f803c933522166f9a91073040f204ca32b6 Mon Sep 17 00:00:00 2001 From: pommicket Date: Wed, 26 Feb 2025 11:58:27 -0500 Subject: minor fixes --- main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 94c5440..603c8ad 100644 --- a/main.c +++ b/main.c @@ -1025,9 +1025,13 @@ int main(int argc, char **argv) { { // set window icon SDL_RWops *ops = SDL_RWFromConstMem(camlet_bmp, camlet_bmp_len); - SDL_Surface *icon = SDL_LoadBMP_RW(ops, true); - SDL_SetWindowIcon(window, icon); - SDL_FreeSurface(icon); + if (ops) { + SDL_Surface *icon = SDL_LoadBMP_RW(ops, true); + if (icon) { + SDL_SetWindowIcon(window, icon); + SDL_FreeSurface(icon); + } + } } state->video = video_init(); -- cgit v1.2.3