summaryrefslogtreecommitdiff
path: root/libavformat/id3v2.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-04 13:41:01 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-04-04 13:41:01 +0200
commitcdafcf838cc7f559b67863183ad1283c97a9ae70 (patch)
tree570f24e0159efb7c525c0237b8d6d23ccd38537c /libavformat/id3v2.c
parentab2989378fc59128b7e372fadceeb376c9e8cae0 (diff)
parent8d617b11cfc87b2c6056fee029ac5bc760af874a (diff)
Merge commit '8d617b11cfc87b2c6056fee029ac5bc760af874a'
* commit '8d617b11cfc87b2c6056fee029ac5bc760af874a': id3v2: pad the APIC packets as required by lavc. dfa: check for invalid access in decode_wdlt(). Conflicts: libavformat/id3v2.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/id3v2.c')
-rw-r--r--libavformat/id3v2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index 989ebf2a05..3567bbc57b 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -490,9 +490,9 @@ static void read_apic(AVFormatContext *s, AVIOContext *pb, int taglen, char *tag
}
apic->buf = av_buffer_alloc(taglen + FF_INPUT_BUFFER_PADDING_SIZE);
- apic->buf->size -= FF_INPUT_BUFFER_PADDING_SIZE;
if (!apic->buf || !taglen || avio_read(pb, apic->buf->data, taglen) != taglen)
goto fail;
+ memset(apic->buf->data + taglen, 0, FF_INPUT_BUFFER_PADDING_SIZE);
new_extra->tag = "APIC";
new_extra->data = apic;
@@ -848,7 +848,7 @@ int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta **extra_meta)
av_init_packet(&st->attached_pic);
st->attached_pic.buf = apic->buf;
st->attached_pic.data = apic->buf->data;
- st->attached_pic.size = apic->buf->size;
+ st->attached_pic.size = apic->buf->size - FF_INPUT_BUFFER_PADDING_SIZE;
st->attached_pic.stream_index = st->index;
st->attached_pic.flags |= AV_PKT_FLAG_KEY;