[vlc-commits] mp4: fix signedness

Rémi Denis-Courmont git at videolan.org
Sat Jun 29 14:55:14 CEST 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jun 29 15:45:36 2019 +0300| [c5da83ca6af92a9a0dec24c5016133a074603e9b] | committer: Rémi Denis-Courmont

mp4: fix signedness

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

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

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 83f36db1a7..b3e5c4ca07 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -3110,7 +3110,6 @@ static int TrackTimeToSampleChunk( demux_t *p_demux, mp4_track_t *p_track,
     uint64_t     i_dts;
     unsigned int i_sample;
     unsigned int i_chunk;
-    int          i_index;
     stime_t      i_start;
 
     /* FIXME see if it's needed to check p_track->i_chunk_count */
@@ -3176,8 +3175,11 @@ static int TrackTimeToSampleChunk( demux_t *p_demux, mp4_track_t *p_track,
     /* *** find sample in the chunk *** */
     i_sample = p_track->chunk[i_chunk].i_sample_first;
     i_dts    = p_track->chunk[i_chunk].i_first_dts;
-    for( i_index = 0;  i_index < p_track->chunk[i_chunk].i_entries_dts &&
-                       i_sample < p_track->chunk[i_chunk].i_sample_count; )
+
+    for( uint_fast32_t i_index = 0;
+         i_index < p_track->chunk[i_chunk].i_entries_dts &&
+         i_sample < p_track->chunk[i_chunk].i_sample_count;
+         i_index++ )
     {
         if( i_dts +
             p_track->chunk[i_chunk].p_sample_count_dts[i_index] *
@@ -3188,7 +3190,6 @@ static int TrackTimeToSampleChunk( demux_t *p_demux, mp4_track_t *p_track,
                 p_track->chunk[i_chunk].p_sample_delta_dts[i_index];
 
             i_sample += p_track->chunk[i_chunk].p_sample_count_dts[i_index];
-            i_index++;
         }
         else
         {



More information about the vlc-commits mailing list