riff: Validate the wav header size before trying to parse it

pull/227/head
Luca Barbato 10 years ago
parent 5bdfc17189
commit 1b4c468477
  1. 3
      libavformat/riffdec.c

@ -79,6 +79,9 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size)
{ {
int id; int id;
if (size < 14)
return AVERROR_INVALIDDATA;
id = avio_rl16(pb); id = avio_rl16(pb);
codec->codec_type = AVMEDIA_TYPE_AUDIO; codec->codec_type = AVMEDIA_TYPE_AUDIO;
codec->channels = avio_rl16(pb); codec->channels = avio_rl16(pb);

Loading…
Cancel
Save