Merge pull request #69 from lioncash/misc
[OGL] Fix a possible null pointer dereference
This commit is contained in:
commit
6064afbe9f
@ -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,
|
static inline bool gl_getpixelformat(HDC hdc, struct gs_init_data *info,
|
||||||
int *format, PIXELFORMATDESCRIPTOR *pfd)
|
int *format, PIXELFORMATDESCRIPTOR *pfd)
|
||||||
{
|
{
|
||||||
*format = gl_choose_pixel_format(hdc, info);
|
|
||||||
|
|
||||||
if (!format)
|
if (!format)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
*format = gl_choose_pixel_format(hdc, info);
|
||||||
|
|
||||||
if (!DescribePixelFormat(hdc, *format, sizeof(*pfd), pfd)) {
|
if (!DescribePixelFormat(hdc, *format, sizeof(*pfd), pfd)) {
|
||||||
blog(LOG_ERROR, "DescribePixelFormat failed, %u",
|
blog(LOG_ERROR, "DescribePixelFormat failed, %u",
|
||||||
GetLastError());
|
GetLastError());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user