[MPlayer-cvslog] r32568 - trunk/libvo/vo_directx.c

reimar subversion at mplayerhq.hu
Sat Oct 30 17:29:20 CEST 2010


Author: reimar
Date: Sat Oct 30 17:29:20 2010
New Revision: 32568

Log:
Fix possible out-of-bounds access.

Modified:
   trunk/libvo/vo_directx.c

Modified: trunk/libvo/vo_directx.c
==============================================================================
--- trunk/libvo/vo_directx.c	Sat Oct 30 12:15:13 2010	(r32567)
+++ trunk/libvo/vo_directx.c	Sat Oct 30 17:29:20 2010	(r32568)
@@ -229,11 +229,11 @@ static uint32_t Directx_CreateOverlay(ui
     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);


More information about the MPlayer-cvslog mailing list