avformat/riffdec: ask for samples with wav header size < 14
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 30 Nov 2014 00:52:04 +0000 (01:52 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 30 Nov 2014 00:55:36 +0000 (01:55 +0100)
Based on commit by Hendrik Leppkes <h.leppkes@gmail.com>

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/riffdec.c

index 09fee9d..88e2229 100644 (file)
@@ -84,6 +84,9 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size)
 {
     int id;
 
 {
     int id;
 
+    if (size < 14)
+        avpriv_request_sample(codec, "wav header size < 14");
+
     id                 = avio_rl16(pb);
     codec->codec_type  = AVMEDIA_TYPE_AUDIO;
     codec->channels    = avio_rl16(pb);
     id                 = avio_rl16(pb);
     codec->codec_type  = AVMEDIA_TYPE_AUDIO;
     codec->channels    = avio_rl16(pb);