Skip to content

Commit

Permalink
egl: guard against null-pointer deref
Browse files Browse the repository at this point in the history
  • Loading branch information
Cory Fields committed Oct 17, 2012
1 parent 6cb41b9 commit b6d2be7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp
Expand Up @@ -80,12 +80,16 @@ bool CEGLNativeTypeAmlogic::CreateNativeWindow()

bool CEGLNativeTypeAmlogic::GetNativeDisplay(EGLNativeDisplayType **nativeDisplay) const
{
if (!nativeDisplay)
return false;
*nativeDisplay = (XBNativeDisplayType*) &m_nativeDisplay;
return true;
}

bool CEGLNativeTypeAmlogic::GetNativeWindow(XBNativeWindowType **nativeWindow) const
{
if (!nativeWindow)
return false;
*nativeWindow = (XBNativeWindowType*) &m_nativeWindow;
return true;
}
Expand Down
4 changes: 4 additions & 0 deletions xbmc/windowing/egl/EGLNativeTypeAndroid.cpp
Expand Up @@ -68,12 +68,16 @@ bool CEGLNativeTypeAndroid::CreateNativeWindow()

bool CEGLNativeTypeAndroid::GetNativeDisplay(XBNativeDisplayType **nativeDisplay) const
{
if (!nativeDisplay)
return false;
*nativeDisplay = (XBNativeDisplayType*) &m_nativeDisplay;
return true;
}

bool CEGLNativeTypeAndroid::GetNativeWindow(XBNativeWindowType **nativeWindow) const
{
if (!nativeWindow)
return false;
*nativeWindow = (XBNativeWindowType*) &m_nativeWindow;
return true;
}
Expand Down
4 changes: 4 additions & 0 deletions xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp
Expand Up @@ -136,13 +136,17 @@ bool CEGLNativeTypeRaspberryPI::CreateNativeWindow()

bool CEGLNativeTypeRaspberryPI::GetNativeDisplay(XBNativeDisplayType **nativeDisplay) const
{
if (!nativeDisplay)
return false;
*nativeDisplay = (XBNativeDisplayType*) &m_nativeDisplay;
return true;
}

bool CEGLNativeTypeRaspberryPI::GetNativeWindow(XBNativeDisplayType **nativeWindow) const
{
DLOG("CEGLNativeTypeRaspberryPI::GetNativeWindow\n");
if (!nativeWindow)
return false;
*nativeWindow = (XBNativeWindowType*) &m_nativeWindow;
return true;
}
Expand Down

0 comments on commit b6d2be7

Please sign in to comment.