[FFmpeg-cvslog] id3v2: pad the APIC packets as required by lavc.

Anton Khirnov git at videolan.org
Sun May 12 13:41:55 CEST 2013


ffmpeg | branch: release/1.1 | Anton Khirnov <anton at khirnov.net> | Thu Mar 28 09:49:38 2013 +0100| [5ebdfbe893c4509f5be6d950fe5f5f25bf52c397] | committer: Anton Khirnov

id3v2: pad the APIC packets as required by lavc.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5ebdfbe893c4509f5be6d950fe5f5f25bf52c397
---

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

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;



More information about the ffmpeg-cvslog mailing list