Browse Source

libobs-d3d11: Remove possible null pointer dereference

jp9000 9 years ago
parent
commit
f6fae9b7e9
1 changed files with 3 additions and 0 deletions
  1. 3 0
      libobs-d3d11/d3d11-subsystem.cpp

+ 3 - 0
libobs-d3d11/d3d11-subsystem.cpp

@@ -2050,6 +2050,9 @@ extern "C" EXPORT void *gs_texture_get_dc(gs_texture_t *tex)
 	if (!TextureGDICompatible(tex2d, "gs_texture_get_dc"))
 		return nullptr;
 
+	if (!tex2d->gdiSurface)
+		return nullptr;
+
 	tex2d->gdiSurface->GetDC(true, &hDC);
 	return hDC;
 }