[vlc-devel] [PATCH 1/1] faad: always drop byte of padding (fixes #5257)
Tristan Matthews
le.businessman at gmail.com
Mon Dec 15 04:41:31 CET 2014
---
modules/codec/faad.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/modules/codec/faad.c b/modules/codec/faad.c
index 9aaaed6..93b492e 100644
--- a/modules/codec/faad.c
+++ b/modules/codec/faad.c
@@ -313,7 +313,7 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
}
/* Decode all data */
- if( p_sys->i_buffer )
+ if( p_sys->i_buffer > 1)
{
void *samples;
faacDecFrameInfo frame;
@@ -395,10 +395,12 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
/* Flush the buffer */
p_sys->i_buffer -= frame.bytesconsumed;
- if( p_sys->i_buffer > 0 )
+ if( p_sys->i_buffer > 1 )
{
memmove( p_sys->p_buffer,&p_sys->p_buffer[frame.bytesconsumed],
p_sys->i_buffer );
+ } else {
+ p_sys->i_buffer = 0;
}
block_Release( p_block );
return NULL;
@@ -507,6 +509,8 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
}
return p_out;
+ } else {
+ p_sys->i_buffer = 0;
}
block_Release( p_block );
--
1.9.3
More information about the vlc-devel
mailing list