Browse code

id3v2: reject APICs with size of 0

fixes ticket #1324

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Piotr Bandurski authored on 2012/05/20 03:58:17
Showing 1 changed files
... ...
@@ -488,7 +488,7 @@ static void read_apic(AVFormatContext *s, AVIOContext *pb, int taglen, char *tag
488 488
 
489 489
     apic->len   = taglen;
490 490
     apic->data  = av_malloc(taglen);
491
-    if (!apic->data || avio_read(pb, apic->data, taglen) != taglen)
491
+    if (!apic->data || !apic->len || avio_read(pb, apic->data, taglen) != taglen)
492 492
         goto fail;
493 493
 
494 494
     new_extra->tag    = "APIC";