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:
David Capello 2015-08-24 12:48:27 -03:00
parent 04f07af173
commit 434059d517

View File

@ -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();