Skip to content
Browse files

egl: guard against null-pointer deref

  • Loading branch information...
1 parent 6cb41b9 commit b6d2be708300b683f12dc972d33ce091e602f542 Cory Fields committed Oct 17, 2012
View
4 xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp
@@ -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;
}
View
4 xbmc/windowing/egl/EGLNativeTypeAndroid.cpp
@@ -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;
}
View
4 xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp
@@ -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;
}

0 comments on commit b6d2be7

Please sign in to comment.
Something went wrong with that request. Please try again.