Przeglądaj źródła

Don't crash if creating D3D device failed

Vincent Lang 9 lat temu
rodzic
commit
b97c8b9418
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      src/player/PlayerQuickItem.cpp

+ 2 - 1
src/player/PlayerQuickItem.cpp

@@ -81,7 +81,8 @@ static void* __stdcall MPGetNativeDisplay(const char* name)
   if (strcmp(name, "IDirect3DDevice9") == 0)
   {
     QLOG_INFO() << "Returning device " << (void *)d3ddevice;
-    IDirect3DDevice9_AddRef(d3ddevice);
+    if (d3ddevice)
+      IDirect3DDevice9_AddRef(d3ddevice);
     return (void *)d3ddevice;
   }
   return NULL;