On Thu, Dec 15, 2011 at 01:36:19PM +0530, Shitiz Garg wrote:
> audio_channel would be sometimes zero and cause floating point exception due
> to division by zero.
> Fixed bugzilla #141
> ---
> libavformat/westwood.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/libavformat/westwood.c b/libavformat/westwood.c
> index 67a00c9..531391f 100644
> --- a/libavformat/westwood.c
> +++ b/libavformat/westwood.c
> @@ -321,6 +321,11 @@ static int wsvqa_read_packet(AVFormatContext *s,
> unsigned int chunk_size;
> int skip_byte;
>
> + if (wsvqa->audio_channels == 0) {
> + av_log(s, AV_LOG_ERROR, "invalid number of audio channels\n");
> + return AVERROR_INVALIDDATA;
> + }
> +
looks wrong
first, such check should be in read_header()
second, VQA can be without audio part
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel