Skip to content

Commit

Permalink
-Fix: Check that video buffer finished initializing before memcmp/memcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
miniupnp committed Jul 13, 2019
1 parent 6dff8b6 commit 0006a11
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/video/video_sdl.c
Expand Up @@ -666,10 +666,12 @@ void Video_Tick(void)

#ifdef _DEBUG
if (!s_showFPS) {
if (!GFX_Screen_IsDirty(SCREEN_0) && memcmp(GFX_Screen_Get_ByIndex(SCREEN_0), s_gfx_screen8, SCREEN_WIDTH * SCREEN_HEIGHT) != 0) {
Warning("**** SCREEN0 DIRTY NOT DETECTED ! ****\n");
if (GFX_Screen_Get_ByIndex(SCREEN_0) != NULL) {
if (!GFX_Screen_IsDirty(SCREEN_0) && memcmp(GFX_Screen_Get_ByIndex(SCREEN_0), s_gfx_screen8, SCREEN_WIDTH * SCREEN_HEIGHT) != 0) {
Warning("**** SCREEN0 DIRTY NOT DETECTED ! ****\n");
}
memcpy(s_gfx_screen8, GFX_Screen_Get_ByIndex(SCREEN_0), SCREEN_WIDTH * SCREEN_HEIGHT);
}
memcpy(s_gfx_screen8, GFX_Screen_Get_ByIndex(SCREEN_0), SCREEN_WIDTH * SCREEN_HEIGHT);
}
#endif /* _DEBUG */

Expand All @@ -689,7 +691,6 @@ void Video_Tick(void)
GFX_Screen_SetClean(SCREEN_0);
s_screen_needrepaint = false;
}

s_video_lock = false;
}

Expand Down

0 comments on commit 0006a11

Please sign in to comment.