# HG changeset patch # User reimar # Date 1288452560 0 # Node ID 983577adcf0e672ec3e5e67cbce35e694d8a80dd # Parent 60453d752380dcd246c25350fe4b53cc0348928a Fix possible out-of-bounds access. diff -r 60453d752380 -r 983577adcf0e libvo/vo_directx.c --- a/libvo/vo_directx.c Sat Oct 30 10:15:13 2010 +0000 +++ b/libvo/vo_directx.c Sat Oct 30 15:29:20 2010 +0000 @@ -229,11 +229,11 @@ 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);