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

This commit is contained in:
Luca Barbato 2015-06-28 17:32:40 +02:00
parent 5bdfc17189
commit 1b4c468477
1 changed files with 3 additions and 0 deletions

View File

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