[vlc-commits] demux: mp4: don't read at all if not content
Francois Cartegnie
git at videolan.org
Wed Sep 24 13:35:13 CEST 2014
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Sep 24 13:32:37 2014 +0200| [2d07e7885945ef30a55a078d956e4b6714c5c1ee] | committer: Francois Cartegnie
demux: mp4: don't read at all if not content
fixes 1 byte read overflow
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2d07e7885945ef30a55a078d956e4b6714c5c1ee
---
modules/demux/mp4/libmp4.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index c198c45..a0e0c5e 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -1396,7 +1396,7 @@ static int MP4_ReadBox_avcC( stream_t *p_stream, MP4_Box_t *p_box )
if( !p_avcC->i_sps_length || !p_avcC->sps )
goto error;
- for( i = 0; i < p_avcC->i_sps && i_read; i++ )
+ for( i = 0; i < p_avcC->i_sps && i_read > 2; i++ )
{
MP4_GET2BYTES( p_avcC->i_sps_length[i] );
if ( p_avcC->i_sps_length[i] > i_read )
@@ -1421,7 +1421,7 @@ static int MP4_ReadBox_avcC( stream_t *p_stream, MP4_Box_t *p_box )
if( !p_avcC->i_pps_length || !p_avcC->pps )
goto error;
- for( i = 0; i < p_avcC->i_pps && i_read; i++ )
+ for( i = 0; i < p_avcC->i_pps && i_read > 2; i++ )
{
MP4_GET2BYTES( p_avcC->i_pps_length[i] );
if( p_avcC->i_pps_length[i] > i_read )
More information about the vlc-commits
mailing list