From 476bdea0c172f082d0a12a70a5cc6eca5f84164e Mon Sep 17 00:00:00 2001 From: Sander van Dijk Date: Wed, 30 May 2012 18:31:41 +0000 Subject: [PATCH] pl_linux.c: Set icon only if mask creation is successful. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@682 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/pl_linux.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Quake/pl_linux.c b/Quake/pl_linux.c index 73879bc8..b06eccb5 100644 --- a/Quake/pl_linux.c +++ b/Quake/pl_linux.c @@ -86,9 +86,12 @@ void PL_SetWindowIcon (void) if (icon == NULL) return; mask = PL_CreateIconMask(icon); - SDL_WM_SetIcon(icon, mask); + if (mask != NULL) + { + SDL_WM_SetIcon(icon, mask); + free(mask); + } SDL_FreeSurface(icon); - free(mask); } void PL_VID_Shutdown (void)