From 4d18f4c15be1b338d30c236d8065d4cac75ceed1 Mon Sep 17 00:00:00 2001 From: Piotr Bandurski Date: Sat, 19 May 2012 20:58:17 +0200 Subject: [PATCH] id3v2: reject APICs with size of 0 fixes ticket #1324 Signed-off-by: Michael Niedermayer --- libavformat/id3v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c index 3b02d2b5b4..216d4a2e57 100644 --- a/libavformat/id3v2.c +++ b/libavformat/id3v2.c @@ -488,7 +488,7 @@ static void read_apic(AVFormatContext *s, AVIOContext *pb, int taglen, char *tag apic->len = taglen; apic->data = av_malloc(taglen); - if (!apic->data || avio_read(pb, apic->data, taglen) != taglen) + if (!apic->data || !apic->len || avio_read(pb, apic->data, taglen) != taglen) goto fail; new_extra->tag = "APIC";