Commit 4cfd989f authored by Frédéric Yhuel's avatar Frédéric Yhuel Committed by 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: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 218c7510
...@@ -3571,7 +3571,7 @@ MP4_Box_t *MP4_BoxGetRoot( stream_t *s ) ...@@ -3571,7 +3571,7 @@ MP4_Box_t *MP4_BoxGetRoot( stream_t *s )
return p_root; return p_root;
p_root->i_size = stream_Size( s ); 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 */ /* Get the rest of the file */
i_result = MP4_ReadBoxContainerRaw( p_stream, p_root ); i_result = MP4_ReadBoxContainerRaw( p_stream, p_root );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment