Skip to content
Snippets Groups Projects
Commit 306505b7 authored by Jonas Dittrich's avatar Jonas Dittrich Committed by Steve Lhomme
Browse files

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.
parent 72f4c14e
No related branches found
No related tags found
1 merge request!4815flac: fix endless bytes skip
Pipeline #429036 passed with stage
in 16 minutes and 2 seconds
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment