- /* Grow output buffer if necessary (eg. for PCM data) */
- p_sys->p_output = av_realloc( p_sys->p_output, i_output );
+ *pp_block = p_block = block_Realloc( p_block, 0, p_block->i_buffer + FF_INPUT_BUFFER_PADDING_SIZE );
+ if( !p_block )
+ return NULL;
+ p_block->i_buffer -= FF_INPUT_BUFFER_PADDING_SIZE;
+ memset( &p_block->p_buffer[p_block->i_buffer], 0, FF_INPUT_BUFFER_PADDING_SIZE );
+
+ p_block->i_flags |= BLOCK_FLAG_PRIVATE_REALLOCATED;