[vlc-commits] demux: mp4: fix qt1 overflow check

Francois Cartegnie git at videolan.org
Tue Apr 29 13:03:32 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Apr 29 12:54:38 2014 +0200| [ab14c2148cbc6d42f7bbe7b8777f18d11fd58fcf] | committer: Francois Cartegnie

demux: mp4: fix qt1 overflow check

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

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

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index e289a2e..1169f8c 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -3078,9 +3078,8 @@ static uint32_t MP4_TrackSampleSize( mp4_track_t *p_track, uint32_t *pi_nb_sampl
         uint32_t i_samples = p_track->chunk[p_track->i_chunk].i_sample_count;
         if( p_track->fmt.audio.i_blockalign > 1 )
             i_samples = p_soun->i_sample_per_packet;
-
         i_size = i_samples / p_soun->i_sample_per_packet;
-        if ( UINT32_MAX / i_size < p_soun->i_bytes_per_frame )
+        if ( UINT32_MAX / i_size >= p_soun->i_bytes_per_frame )
             i_size *= p_soun->i_bytes_per_frame;
         else
             i_size = UINT32_MAX;



More information about the vlc-commits mailing list