Forráskód Böngészése

libobs-d3d11: Remove possible null pointer dereference

jp9000 9 éve
szülő
commit
f6fae9b7e9
1 módosított fájl, 3 hozzáadás és 0 törlés
  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"))
 	if (!TextureGDICompatible(tex2d, "gs_texture_get_dc"))
 		return nullptr;
 		return nullptr;
 
 
+	if (!tex2d->gdiSurface)
+		return nullptr;
+
 	tex2d->gdiSurface->GetDC(true, &hDC);
 	tex2d->gdiSurface->GetDC(true, &hDC);
 	return hDC;
 	return hDC;
 }
 }