diff options
Diffstat (limited to 'libvo/vo_directx.c')
-rw-r--r-- | libvo/vo_directx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libvo/vo_directx.c b/libvo/vo_directx.c index 00294b881d..9a940c6553 100644 --- a/libvo/vo_directx.c +++ b/libvo/vo_directx.c @@ -224,11 +224,11 @@ static uint32_t Directx_CreateOverlay(uint32_t imgfmt) HRESULT ddrval; DDSURFACEDESC2 ddsdOverlay; uint32_t i=0; - while ( i < NUM_FORMATS +1 && imgfmt != g_ddpf[i].img_format) + while ( i < NUM_FORMATS && imgfmt != g_ddpf[i].img_format) { i++; } - if (!g_lpdd || !g_lpddsPrimary) + if (!g_lpdd || !g_lpddsPrimary || i == NUM_FORMATS) return 1; //cleanup if (g_lpddsOverlay)g_lpddsOverlay->lpVtbl->Release(g_lpddsOverlay); |