On Thu, Dec 15, 2011 at 02:21:13PM +0530, Shitiz Garg wrote:
> audio header information might get scrambled and would not parse, yet 
> wsqva_read_packet would try to parse audio packets causing segfaults such as 
> floating point exception
> Fixes bugzilla #141

please format the message to be in 78 characters per line limit

> ---
>  libavformat/westwood.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/libavformat/westwood.c b/libavformat/westwood.c
> index 67a00c9..23c2677 100644
> --- a/libavformat/westwood.c
> +++ b/libavformat/westwood.c
> @@ -326,6 +326,11 @@ static int wsvqa_read_packet(AVFormatContext *s,
>          chunk_size = AV_RB32(&preamble[4]);
>          skip_byte = chunk_size & 0x01;
>  
> +        if ((chunk_type == SND2_TAG || chunk_type == SND1_TAG) && 
> wsvqa->audio_channels == 0) {
> +            av_log(s, AV_LOG_ERROR, "audio chunk without any audio header 
> information found\n");
> +            return AVERROR_INVALIDDATA;
> +        }
> +        
>          if ((chunk_type == SND1_TAG) || (chunk_type == SND2_TAG) || 
> (chunk_type == VQFR_TAG)) {
>  
>              if (av_new_packet(pkt, chunk_size))
> -- 

the patch itself looks good
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to