mirror of https://github.com/mpv-player/mpv
vo_directx: Fix possible out-of-bounds access
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32568 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
d067f6a2a0
commit
0142db087b
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue