[vlc-commits] demux: mp4: fix reading max samples (fix #12764)

Francois Cartegnie git at videolan.org
Sat Nov 15 14:18:56 CET 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Nov 15 14:16:33 2014 +0100| [5676fd5bf296cd8c1e4de9029ad8c033062b5faf] | committer: Francois Cartegnie

demux: mp4: fix reading max samples (fix #12764)

p_chunk->i_sample is next sample, not current

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

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

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index b8b0dc9..ae629dc 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -2996,7 +2996,7 @@ static uint32_t MP4_TrackGetReadSize( mp4_track_t *p_track, uint32_t *pi_nb_samp
     {
         const MP4_Box_data_sample_soun_t *p_soun = p_track->p_sample->data.p_sample_soun;
         const mp4_chunk_t *p_chunk = &p_track->chunk[p_track->i_chunk];
-        uint32_t i_max_samples = p_chunk->i_sample_count - p_chunk->i_sample + 1;
+        uint32_t i_max_samples = p_chunk->i_sample_count - p_chunk->i_sample;
 
         /* Group audio packets so we don't call demux for single sample unit */
         if( p_track->fmt.i_original_fourcc == VLC_CODEC_DVD_LPCM &&



More information about the vlc-commits mailing list