소스 검색

Fix a possible null pointer dereference

Lioncash 11 년 전
부모
커밋
96031f2392
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      libobs-opengl/gl-windows.c

+ 2 - 2
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());