From 96031f23924bcbbce0b7ed0cf787f20e29cef34e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 21 Apr 2014 21:28:40 -0400 Subject: [PATCH] Fix a possible null pointer dereference --- libobs-opengl/gl-windows.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libobs-opengl/gl-windows.c b/libobs-opengl/gl-windows.c index 3b30e53d3..e97bc1700 100644 --- a/libobs-opengl/gl-windows.c +++ b/libobs-opengl/gl-windows.c @@ -310,11 +310,11 @@ static int gl_choose_pixel_format(HDC hdc, struct gs_init_data *info) static inline bool gl_getpixelformat(HDC hdc, struct gs_init_data *info, int *format, PIXELFORMATDESCRIPTOR *pfd) { - *format = gl_choose_pixel_format(hdc, info); - if (!format) return false; + *format = gl_choose_pixel_format(hdc, info); + if (!DescribePixelFormat(hdc, *format, sizeof(*pfd), pfd)) { blog(LOG_ERROR, "DescribePixelFormat failed, %u", GetLastError());