[vlc-commits] demux: mp4: fix reading stsd v2 extensions
Francois Cartegnie
git at videolan.org
Thu Jul 21 17:34:25 CEST 2016
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jul 21 17:20:02 2016 +0200| [287979713ff2d0c41d38274885c652639cf3971b] | committer: Francois Cartegnie
demux: mp4: fix reading stsd v2 extensions
miscomputed offset breaking audio extensions
like channels mapping.
regression refs #12002 sample
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=287979713ff2d0c41d38274885c652639cf3971b
---
modules/demux/mp4/libmp4.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index ed71bc3..2341f89 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -2165,10 +2165,11 @@ static int MP4_ReadBox_sample_soun( stream_t *p_stream, MP4_Box_t *p_box )
p_box->data.p_sample_soun->i_constbytesperaudiopacket,
p_box->data.p_sample_soun->i_constLPCMframesperaudiopacket );
#endif
- /* @72 bytes */
- i_extoffset = VLC_CLIP( i_extoffset, i_read, p_box->i_size );
- p_peek += i_extoffset;
- i_read -= i_extoffset;
+ /* @72 bytes + */
+ if( i_extoffset > i_actually_read )
+ i_extoffset = i_actually_read;
+ p_peek = &p_buff[i_extoffset];
+ i_read = i_actually_read - i_extoffset;
}
else
{
More information about the vlc-commits
mailing list