From b2c2589ecf87e6d42d4134e726552a35b2820e09 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 14 Dec 2012 17:55:25 +0100 Subject: westwood_vqa: fix null pointer dereference Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- libavformat/westwood_vqa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libavformat/westwood_vqa.c') diff --git a/libavformat/westwood_vqa.c b/libavformat/westwood_vqa.c index 708f3e5fc3..c996dad8a2 100644 --- a/libavformat/westwood_vqa.c +++ b/libavformat/westwood_vqa.c @@ -233,7 +233,8 @@ static int wsvqa_read_packet(AVFormatContext *s, switch (chunk_type) { case SND1_TAG: /* unpacked size is stored in header */ - pkt->duration = AV_RL16(pkt->data) / wsvqa->channels; + if(pkt->data) + pkt->duration = AV_RL16(pkt->data) / wsvqa->channels; break; case SND2_TAG: /* 2 samples/byte, 1 or 2 samples per frame depending on stereo */ -- cgit v1.2.3