Przeglądaj źródła

Fixed crash when the graphics driver is upgraded while the renderer is running

Sam Lantinga 11 miesięcy temu
rodzic
commit
eb26f439d8
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      src/render/direct3d11/SDL_render_d3d11.c

+ 4 - 0
src/render/direct3d11/SDL_render_d3d11.c

@@ -2394,6 +2394,10 @@ static int D3D11_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *c
     ID3D11SamplerState *textureSampler;
     PixelShaderConstants constants;
 
+    if (!textureData) {
+        return SDL_SetError("Texture is not currently available");
+    }
+
     D3D11_SetupShaderConstants(renderer, cmd, texture, &constants);
 
     switch (textureData->scaleMode) {