wddlock.c: Don't use _al_wd_dirty_lines if it's null

Related to issue 359: Program exits unexpectently after minimizing
and maximizing too fast.

I should find the cause of _al_wd_dirty_lines = NULL, but I wasn't able
to reproduce this bug, so at the moment this is the best I can do to avoid
a crash. (I suppose that it's related to a temporary invalid state because
thread sync issues when the screen/window changes its size.)
This commit is contained in:
David Capello 2014-03-08 21:34:48 -03:00
parent 45f0166508
commit 15f55c045c

View File

@ -29,6 +29,10 @@ static void update_dirty_lines(BITMAP *bmp)
RECT rect;
int i;
ASSERT(_al_wd_dirty_lines != NULL);
if (_al_wd_dirty_lines == NULL)
return;
/* The width is always the full bitmap width, because we have no
* mechanism for measuring the X range of the update.
*/
@ -73,7 +77,10 @@ void gfx_directx_unwrite_bank(BITMAP *bmp)
uintptr_t gfx_directx_write_bank_win(BITMAP *bmp, int line)
{
_al_wd_dirty_lines[bmp->y_ofs+line] = 1;
ASSERT(_al_wd_dirty_lines != NULL);
if (_al_wd_dirty_lines != NULL)
_al_wd_dirty_lines[bmp->y_ofs+line] = 1;
if (!(bmp->id & BMP_ID_LOCKED))
gfx_directx_autolock(bmp);