aboutsummaryrefslogtreecommitdiffhomepage
path: root/libvo
diff options
context:
space:
mode:
authorGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-10-30 15:29:20 +0000
committerGravatar Uoti Urpala <uau@glyph.nonexistent.invalid>2010-11-07 21:48:37 +0200
commit0142db087bf9b61579862423e8b37a3970b89445 (patch)
treef4f661397c9da9b651283046b1924f7b1c1a78a8 /libvo
parentd067f6a2a0d718aa795f0698d20bae4caca7d117 (diff)
vo_directx: Fix possible out-of-bounds access
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32568 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_directx.c4
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);