[vlc-commits] demux: mp4: fix builtin sample size computing (fix #18224)

Francois Cartegnie git at videolan.org
Thu Apr 13 15:58:18 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Apr 13 15:48:16 2017 +0200| [47020df3ec4503fb14baa80a363200637ac286c2] | committer: Francois Cartegnie

demux: mp4: fix builtin sample size computing (fix #18224)

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

 modules/demux/mp4/mp4.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index e6627ce1c1..fdd0824818 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -3379,7 +3379,7 @@ static inline uint32_t MP4_GetFixedSampleSize( const mp4_track_t *p_track,
 
      /* QuickTime "built-in" support case fixups */
     if( p_track->fmt.i_cat == AUDIO_ES &&
-        p_soun->i_compressionid == 0 && p_track->i_sample_size == 1 )
+        p_soun->i_compressionid == 0 && p_track->i_sample_size <= 2 )
     {
         switch( p_track->fmt.i_codec )
         {
@@ -3398,7 +3398,8 @@ static inline uint32_t MP4_GetFixedSampleSize( const mp4_track_t *p_track,
         case VLC_CODEC_F32B:
         case VLC_CODEC_F64L:
         case VLC_CODEC_F64B:
-            i_size = ((p_soun->i_samplesize+7)/8) * p_soun->i_channelcount;
+            if( p_track->i_sample_size < ((p_soun->i_samplesize+7U)/8U) * p_soun->i_channelcount )
+                i_size = ((p_soun->i_samplesize+7)/8) * p_soun->i_channelcount;
             break;
         case VLC_CODEC_ALAW:
         case VLC_FOURCC( 'u', 'l', 'a', 'w' ):



More information about the vlc-commits mailing list