[vlc-commits] libmp4: minor bug fix

Frédéric Yhuel git at videolan.org
Mon Jan 21 23:02:29 CET 2013


vlc | branch: master | Frédéric Yhuel <yhuelf at gmail.com> | Mon Jan 21 22:58:10 2013 +0100| [4cfd989f0b2ea5ec0d175a15383875ce10a84f67] | committer: Jean-Baptiste Kempf

libmp4: minor bug fix

If we read all the stream but n bytes, 0 < n < 8, there's no point to
try and read these n missing bytes.

If we try to continue the parsing, MP4_ReadBoxCommon() would return 0,
and VLC would fall back to avformat's demux while it is not necessary.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4cfd989f0b2ea5ec0d175a15383875ce10a84f67
---

 modules/demux/mp4/libmp4.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 8979691..bcd0df8 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -3571,7 +3571,7 @@ MP4_Box_t *MP4_BoxGetRoot( stream_t *s )
         return p_root;
 
     p_root->i_size = stream_Size( s );
-    if( stream_Tell( s ) < stream_Size( s ) )
+    if( stream_Tell( s ) + 8 < stream_Size( s ) )
     {
         /* Get the rest of the file */
         i_result = MP4_ReadBoxContainerRaw( p_stream, p_root );



More information about the vlc-commits mailing list