[vlc-devel] [PATCH] araw: fix passthrough copying

Rafaël Carré funman at videolan.org
Mon Nov 11 17:55:22 CET 2013


Hello,

Le 10/11/2013 17:29, Tristan Matthews a écrit :
> Fixes #9343 where in->i_buffer is greater than in->i_nb_samples * sizeof(frame).

In which case does this happen?

BTW out->i_buffer is equivalent to
in->i_nb_samples * enc->fmt_out.audio.i_bytes_per_frame
which is used 2 times, worth having a variable for it?

> ---
>  modules/codec/araw.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/modules/codec/araw.c b/modules/codec/araw.c
> index 0d5c300..d4bd4b0 100644
> --- a/modules/codec/araw.c
> +++ b/modules/codec/araw.c
> @@ -739,7 +739,7 @@ static block_t *Encode( encoder_t *enc, block_t *in )
>          encode( out->p_buffer, in->p_buffer, in->i_nb_samples
>                                               * enc->fmt_out.audio.i_channels );
>      else
> -        memcpy( out->p_buffer, in->p_buffer, in->i_buffer );
> +        memcpy( out->p_buffer, in->p_buffer, out->i_buffer );
>      return out;
>  }
>  
> 




More information about the vlc-devel mailing list