On Wed, Mar 21, 2012 at 11:27:05AM -0700, Alex Converse wrote:
> This prevents a SIGFPE later on.
> 
> Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
> CC: libav-sta...@libav.org
> ---
>  libavformat/xwma.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/libavformat/xwma.c b/libavformat/xwma.c
> index 2c6ee11..20845ef 100644
> --- a/libavformat/xwma.c
> +++ b/libavformat/xwma.c
> @@ -115,6 +115,11 @@ static int xwma_read_header(AVFormatContext *s)
>          }
>      }
>  
> +    if (!st->codec->channels)
> +        return AVERROR_INVALIDDATA;
> +    if (!st->codec->bits_per_coded_sample)
> +        return AVERROR_INVALIDDATA;
> +
>      /* set the sample rate */
>      avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
>  
> -- 

an error message would be nice, otherwise LGTM
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to