| Summary: | An attempt to release NULL Direct3d surface | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Evgeny <y.bukhtoyarov> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | critical | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | x86 | ||
| OS: | Windows 7 | ||
Fixed, thanks! http://hg.libsdl.org/SDL/rev/031a1fd143ec |
Method static void D3D_DestroyRenderer(SDL_Renderer * renderer) has a critical problem. It may try to release IDirect3DSurface9 surface pointed by NULL pointer. That leads to really wierd consequences on my system. It happens when the previous call to IDirect3D9_CreateDevice() fails leaving D3D_RenderData::defaultRenderTarget uninitialized. I was able to fix this by replacing this line: IDirect3DSurface9_Release(data->defaultRenderTarget); with the following: if (data->defaultRenderTarget != NULL) { IDirect3DSurface9_Release(data->defaultRenderTarget); data->defaultRenderTarget = NULL; }