Commit b2c2589e authored by Michael Niedermayer's avatar Michael Niedermayer

westwood_vqa: fix null pointer dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 3c5c6b9d
...@@ -233,7 +233,8 @@ static int wsvqa_read_packet(AVFormatContext *s, ...@@ -233,7 +233,8 @@ static int wsvqa_read_packet(AVFormatContext *s,
switch (chunk_type) { switch (chunk_type) {
case SND1_TAG: case SND1_TAG:
/* unpacked size is stored in header */ /* 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; break;
case SND2_TAG: case SND2_TAG:
/* 2 samples/byte, 1 or 2 samples per frame depending on stereo */ /* 2 samples/byte, 1 or 2 samples per frame depending on stereo */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment