riff: Validate the wav header size before trying to parse it
ffmpeg | branch: master | Luca Barbato <lu_zero@gentoo.org> | Sun Jun 28 17:32:40 2015 +0200| [1b4c468477f3b8d372da8ef4e5405539ad9c1501] | committer: Luca Barbato riff: Validate the wav header size before trying to parse it
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1b4c468477f3b8d372...
libavformat/riffdec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c index 74f93ac..2c43afc 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);
participants (1)
-
git@videolan.org