From 1b4c468477f3b8d372da8ef4e5405539ad9c1501 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Sun, 28 Jun 2015 17:32:40 +0200 Subject: riff: Validate the wav header size before trying to parse it --- libavformat/riffdec.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavformat/riffdec.c') diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c index 74f93acedf..2c43afc27c 100644 --- a/libavformat/riffdec.c +++ b/libavformat/riffdec.c @@ -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); -- cgit v1.2.3