asfdec: alloc enough space for storing name in asf_read_metadata_obj
authorAlexandra Hájková <alexandra.khirnova@gmail.com>
Wed, 2 Sep 2015 12:27:42 +0000 (14:27 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Sun, 6 Sep 2015 18:48:36 +0000 (20:48 +0200)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavformat/asfdec.c

index 4b04227..1790096 100644 (file)
@@ -583,7 +583,7 @@ static int asf_read_metadata_obj(AVFormatContext *s, const GUIDParseTable *g)
             break;
         type     = avio_rl16(pb);
         val_len  = avio_rl32(pb);
-        name     = av_malloc(name_len);
+        name     = av_malloc(buflen);
         if (!name)
             return AVERROR(ENOMEM);
         avio_get_str16le(pb, name_len, name,