[vlc-commits] [Git][videolan/vlc][3.0.x] flac: fix endless bytes skip

François Cartegnie (@fcartegnie) gitlab at videolan.org
Sun Sep 6 15:50:07 UTC 2026



François Cartegnie pushed to branch 3.0.x at VideoLAN / VLC


Commits:
957d4658 by Jonas Dittrich at 2026-09-06T17:44:09+02:00
flac: fix endless bytes skip

A hang was caused when the stream head is invalid and a header should be skipped, but not enough data is available. In this case, block_SkipBytes returns VLC_EGENERIC and does not seek anything. So, the same invalid block is processed again and again.

(cherry picked from commit 306505b7c460a7078bf2ce481dd8c5d866c6f8c7)

- - - - -


1 changed file:

- modules/packetizer/flac.c


Changes:

=====================================
modules/packetizer/flac.c
=====================================
@@ -460,7 +460,9 @@ static block_t *Packetize(decoder_t *p_dec, block_t **pp_block)
             msg_Warn(p_dec, "discarding bytes as we're over framesize %u, %zu",
                      p_sys->stream_info.max_framesize,
                      p_sys->i_offset);
-            block_SkipBytes( &p_sys->bytestream, FLAC_HEADER_SIZE_MAX + 2 );
+            if( block_SkipBytes( &p_sys->bytestream,
+                                 FLAC_HEADER_SIZE_MAX + 2 ) != VLC_SUCCESS )
+                return NULL;
             block_BytestreamFlush( &p_sys->bytestream );
             p_sys->crc = 0;
             p_sys->i_buf_offset = 0;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/957d46585e31716e8225b35ec267a68d6d761ca9

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/957d46585e31716e8225b35ec267a68d6d761ca9
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