mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-26 18:21:44 +00:00
Don't access to the first item in DirectDraw surfaces list outside the gfx critical region
This could be a fix for a long-standing crash in gfx_directx_restore_surface() accesing to an invalid memory address.
This commit is contained in:
parent
04f07af173
commit
434059d517
@ -113,10 +113,11 @@ void unregister_all_ddraw_surfaces(void)
|
||||
*/
|
||||
int restore_all_ddraw_surfaces(void)
|
||||
{
|
||||
DDRAW_SURFACE *item = ddraw_surface_list;
|
||||
DDRAW_SURFACE *item;
|
||||
|
||||
_enter_gfx_critical();
|
||||
|
||||
item = ddraw_surface_list;
|
||||
while (item) {
|
||||
if (gfx_directx_restore_surface(item) != 0) {
|
||||
_exit_gfx_critical();
|
||||
|
Loading…
Reference in New Issue
Block a user