mirror of https://git.ffmpeg.org/ffmpeg.git
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>
This commit is contained in:
commit
cdafcf838c
|
@ -261,6 +261,8 @@ static int decode_wdlt(GetByteContext *gb, uint8_t *frame, int width, int height
|
|||
segments = bytestream2_get_le16(gb);
|
||||
}
|
||||
line_ptr = frame;
|
||||
if (frame_end - frame < width)
|
||||
return AVERROR_INVALIDDATA;
|
||||
frame += width;
|
||||
y++;
|
||||
while (segments--) {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue