[vlc-commits] [Git][videolan/vlc][master] flac: fix endless bytes skip
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sun Jan 21 12:48:00 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
306505b7 by Jonas Dittrich at 2024-01-21T12:26:57+00: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.
- - - - -
1 changed file:
- modules/packetizer/flac.c
Changes:
=====================================
modules/packetizer/flac.c
=====================================
@@ -459,7 +459,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/306505b7c460a7078bf2ce481dd8c5d866c6f8c7
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/306505b7c460a7078bf2ce481dd8c5d866c6f8c7
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