Commit 937911d5 authored by Tristan Matthews's avatar Tristan Matthews

faad: drop byte of padding for raw streams

Fixes #2575, #11514
parent c4b10db3
......@@ -491,8 +491,19 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_sys->i_buffer -= frame.bytesconsumed;
if( p_sys->i_buffer > 0 )
{
memmove( p_sys->p_buffer, &p_sys->p_buffer[frame.bytesconsumed],
p_sys->i_buffer );
/* drop byte of raw AAC padding (if present) */
if ( frame.header_type == RAW &&
p_sys->i_buffer == 1 &&
p_sys->p_buffer[0] == 0x21 &&
p_sys->p_buffer[frame.bytesconsumed] == 0 )
{
p_sys->i_buffer = 0;
}
else
{
memmove( p_sys->p_buffer, &p_sys->p_buffer[frame.bytesconsumed],
p_sys->i_buffer );
}
}
return p_out;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment