[vlc-commits] [Git][videolan/vlc][master] 2 commits: demux: mp4: fix APV invalid deref

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sat Aug 15 08:28:30 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
769823f1 by François Cartegnie at 2026-08-15T10:11:33+02:00
demux: mp4: fix APV invalid deref

refs #29677

- - - - -
4c0f35dd by François Cartegnie at 2026-08-15T10:11:33+02:00
demux: mp4: move APV code to proper handler

- - - - -


1 changed file:

- modules/demux/mp4/mp4.c


Changes:

=====================================
modules/demux/mp4/mp4.c
=====================================
@@ -926,6 +926,18 @@ static block_t * MP4_Block_Convert( demux_t *p_demux, const mp4_track_t *p_track
     {
         p_block = MP4_RTPHint_Convert( p_demux, p_block, p_track->fmt.i_codec );
     }
+    else if ( p_track->fmt.i_codec == VLC_CODEC_APV )
+    {
+        // the APU are preceeded by 4 bytes containing the size of the data
+        // this is not used by decoder like libavcodec or openapv.
+        if( p_block->i_buffer < 4 )
+        {
+            block_Release( p_block );
+            return NULL;
+        }
+        p_block->p_buffer += 4;
+        p_block->i_buffer -= 4;
+    }
 
     return p_block;
 }
@@ -1726,14 +1738,6 @@ static int DemuxTrack( demux_t *p_demux, mp4_track_t *tk, uint64_t i_readpos,
 
             p_block->i_length = MP4_GetSamplesDuration( tk, i_nb_samples );
 
-            if ( tk->fmt.i_codec == VLC_CODEC_APV )
-            {
-                // the APU are preceeded by 4 bytes containing the size of the data
-                // this is not used by decoder like libavcodec or openapv.
-                p_block->p_buffer += 4;
-                p_block->i_buffer -= 4;
-            }
-
             MP4_Block_Send( p_demux, tk, p_block );
         }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/37168adfa337f6ff999530c86d44526a0f14966e...4c0f35dd7bf7219df1e98b5640aaaf57b28d072c

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/37168adfa337f6ff999530c86d44526a0f14966e...4c0f35dd7bf7219df1e98b5640aaaf57b28d072c
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list