Skip to content

Commit

Permalink
fixed: window manager icon missing on X11
Browse files Browse the repository at this point in the history
regression after image code refactorization (cc5ed3c)
  • Loading branch information
spiff committed Aug 13, 2012
1 parent aed9109 commit c1dc5ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xbmc/windowing/X11/WinSystemX11.cpp
Expand Up @@ -132,11 +132,11 @@ bool CWinSystemX11::CreateNewWindow(const CStdString& name, bool fullScreen, RES
if(!SetFullScreen(fullScreen, res, false))
return false;

CTexture iconTexture;
iconTexture.LoadFromFile("special://xbmc/media/icon.png");
CBaseTexture* iconTexture = CTexture::LoadFromFile("special://xbmc/media/icon.png");

SDL_WM_SetIcon(SDL_CreateRGBSurfaceFrom(iconTexture.GetPixels(), iconTexture.GetWidth(), iconTexture.GetHeight(), 32, iconTexture.GetPitch(), 0xff0000, 0x00ff00, 0x0000ff, 0xff000000L), NULL);
SDL_WM_SetIcon(SDL_CreateRGBSurfaceFrom(iconTexture->GetPixels(), iconTexture->GetWidth(), iconTexture->GetHeight(), 32, iconTexture->GetPitch(), 0xff0000, 0x00ff00, 0x0000ff, 0xff000000L), NULL);
SDL_WM_SetCaption("XBMC Media Center", NULL);
delete iconTexture;

// register XRandR Events
#if defined(HAS_XRANDR)
Expand Down

1 comment on commit c1dc5ee

@kylhill
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe CTexture::LoadFromFile() can return NULL on error. We can dereference a NULL pointer when calling iconTexture->GetPixels().

Please sign in to comment.