[vlc-commits] modules/packetizer/dirac.c: check index before dereferencing
Nickolai Zeldovich
git at videolan.org
Sun Jan 6 11:59:42 CET 2013
vlc | branch: master | Nickolai Zeldovich <nickolai at csail.mit.edu> | Sat Jan 5 18:03:45 2013 -0500| [c3abb59fdf364fdfee0e66feb4ee14a647f9469a] | committer: Rafaël Carré
modules/packetizer/dirac.c: check index before dereferencing
Check that frame_rate_index is within bounds before dereferencing
the dirac_frate_tbl[] array.
Signed-off-by: Rafaël Carré <funman at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c3abb59fdf364fdfee0e66feb4ee14a647f9469a
---
modules/packetizer/dirac.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/packetizer/dirac.c b/modules/packetizer/dirac.c
index 9f27185..04ec28a 100644
--- a/modules/packetizer/dirac.c
+++ b/modules/packetizer/dirac.c
@@ -571,13 +571,13 @@ static bool dirac_UnpackSeqHdr( struct seq_hdr_t *p_sh, block_t *p_block )
if( dirac_bool( &bs ) )
{
uint32_t frame_rate_index = dirac_uint( &bs );
- p_sh->u_fps_num = dirac_frate_tbl[frame_rate_index].u_n;
- p_sh->u_fps_den = dirac_frate_tbl[frame_rate_index].u_d;
if( frame_rate_index >= dirac_frate_tbl_size )
{
/* invalid header */
return false;
}
+ p_sh->u_fps_num = dirac_frate_tbl[frame_rate_index].u_n;
+ p_sh->u_fps_den = dirac_frate_tbl[frame_rate_index].u_d;
if( frame_rate_index == 0 )
{
p_sh->u_fps_num = dirac_uint( &bs ); /* frame_rate_numerator */
More information about the vlc-commits
mailing list