[vlc-devel] [PATCH] Audio core: avoid FPE in aout_ChannelReorder

Rafaël Carré funman at videolan.org
Thu Oct 10 13:51:04 CEST 2013


Hello,

Patch is OK.

Le 10/10/2013 10:54, Jean-Baptiste Kempf a écrit :
> aout_BitsPerSample can return 0 in some valid situations
> ---
>  src/audio_output/common.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/audio_output/common.c b/src/audio_output/common.c
> index b66f16c..51ce0fc 100644
> --- a/src/audio_output/common.c
> +++ b/src/audio_output/common.c
> @@ -322,6 +322,8 @@ do { \
>          default:
>          {
>              unsigned size = aout_BitsPerSample( fourcc ) / 8;
> +            if( size == 0 ) return;

Please put return on its own line though, I prefer it to the one line
version

>              const size_t frames = bytes / (size * channels);
>              unsigned char *buf = ptr;
>  
> 




More information about the vlc-devel mailing list