packetizer: dts: check for frame_size for the first sync
authorThomas Guillem <thomas@gllm.fr>
Wed, 11 Sep 2024 06:16:36 +0000 (08:16 +0200)
committerSebastian Ramacher <sramacher@debian.org>
Tue, 21 Jan 2025 18:02:47 +0000 (19:02 +0100)
Only substreams are allowed to have a frame_size of 0.

(cherry picked from commit 16b31aa57e3919dbe661c213868dee4b8bc1e3bd)
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
Gbp-Pq: Name 0030-packetizer-dts-check-for-frame_size-for-the-first-sy.patch

modules/packetizer/dts.c

index a57c6989ebe6d404a958eef8dd5133a238672554..5d0deb4e563344362507aebc23c88364108f0438 100644 (file)
@@ -205,7 +205,8 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block )
 
             /* Check if frame is valid and get frame info */
             if( vlc_dts_header_Parse( &p_sys->first, p_header,
-                                      VLC_DTS_HEADER_SIZE ) != VLC_SUCCESS )
+                                      VLC_DTS_HEADER_SIZE ) != VLC_SUCCESS
+             || p_sys->first.i_frame_size == 0 )
             {
                 msg_Dbg( p_dec, "emulated sync word" );
                 block_SkipByte( &p_sys->bytestream );