[FFmpeg-cvslog] riff: Validate the wav header size before trying to parse it

Luca Barbato git at videolan.org
Tue Jun 30 13:06:31 CEST 2015


ffmpeg | branch: master | Luca Barbato <lu_zero at 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=1b4c468477f3b8d372da8ef4e5405539ad9c1501
---

 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);



More information about the ffmpeg-cvslog mailing list