Module: libav
Branch: release/9
Commit: 5ebdfbe893c4509f5be6d950fe5f5f25bf52c397

Author:    Anton Khirnov <[email protected]>
Committer: Anton Khirnov <[email protected]>
Date:      Thu Mar 28 09:49:38 2013 +0100

id3v2: pad the APIC packets as required by lavc.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: [email protected]

---

 libavformat/id3v2.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index 4516ac7..7f39a47 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -477,9 +477,10 @@ static void read_apic(AVFormatContext *s, AVIOContext *pb, 
int taglen, char *tag
     }
 
     apic->len   = taglen;
-    apic->data  = av_malloc(taglen);
+    apic->data  = av_malloc(taglen + FF_INPUT_BUFFER_PADDING_SIZE);
     if (!apic->data || avio_read(pb, apic->data, taglen) != taglen)
         goto fail;
+    memset(apic->data + taglen, 0, FF_INPUT_BUFFER_PADDING_SIZE);
 
     new_extra->tag    = "APIC";
     new_extra->data   = apic;

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to