[vlc-commits] [Git][videolan/vlc][master] 2 commits: demux: libmp4: stts durations are unsigned

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat May 20 14:28:51 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
48cba2f0 by Francois Cartegnie at 2023-05-20T14:02:48+00:00
demux: libmp4: stts durations are unsigned

- - - - -
e9d0af87 by Francois Cartegnie at 2023-05-20T14:02:48+00:00
demux: mp4: patch invalid stts durations

negative or zero durations from cameras

refs #28134

- - - - -


2 changed files:

- modules/demux/mp4/libmp4.c
- modules/demux/mp4/libmp4.h


Changes:

=====================================
modules/demux/mp4/libmp4.c
=====================================
@@ -1576,7 +1576,7 @@ static int MP4_ReadBox_stts( stream_t *p_stream, MP4_Box_t *p_box )
     }
 
     p_box->data.p_stts->pi_sample_count = vlc_alloc( count, sizeof(uint32_t) );
-    p_box->data.p_stts->pi_sample_delta = vlc_alloc( count, sizeof(int32_t) );
+    p_box->data.p_stts->pi_sample_delta = vlc_alloc( count, sizeof(uint32_t) );
     p_box->data.p_stts->i_entry_count = count;
 
     if( p_box->data.p_stts->pi_sample_count == NULL
@@ -1589,6 +1589,10 @@ static int MP4_ReadBox_stts( stream_t *p_stream, MP4_Box_t *p_box )
     {
         MP4_GET4BYTES( p_box->data.p_stts->pi_sample_count[i] );
         MP4_GET4BYTES( p_box->data.p_stts->pi_sample_delta[i] );
+        /* Patch bogus durations, including negative stored values */
+        if( p_box->data.p_stts->pi_sample_delta[i] == 0 ||
+            p_box->data.p_stts->pi_sample_delta[i] >= 0xF0000000 )
+            p_box->data.p_stts->pi_sample_delta[i] = 1;
     }
 
 #ifdef MP4_VERBOSE


=====================================
modules/demux/mp4/libmp4.h
=====================================
@@ -678,7 +678,7 @@ typedef struct MP4_Box_data_stts_s
 
     uint32_t i_entry_count;
     uint32_t *pi_sample_count; /* these are array */
-    int32_t  *pi_sample_delta;
+    uint32_t *pi_sample_delta;
 
 } MP4_Box_data_stts_t;
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/603e9f1a61e034bfa1cbd4e5c534bb29ead60546...e9d0af87a6967309819caae94594ca6eb3e069e1

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/603e9f1a61e034bfa1cbd4e5c534bb29ead60546...e9d0af87a6967309819caae94594ca6eb3e069e1
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list