diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-03-15 13:34:14 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-15 13:34:20 +0100 |
commit | 5be70f58260efc9f4718fe5dd842d20b9eca391c (patch) | |
tree | 368a8908fd2971d77ffa1d71f6e7dbdcdaad45f2 /libavcodec/apedec.c | |
parent | 231795270b67496e01ad87731e0e95853146f038 (diff) | |
parent | 9652d4fcfc9c07a726b35efc4ac644d9751b36d7 (diff) | |
download | ffmpeg-5be70f58260efc9f4718fe5dd842d20b9eca391c.tar.gz |
Merge commit '9652d4fcfc9c07a726b35efc4ac644d9751b36d7'
* commit '9652d4fcfc9c07a726b35efc4ac644d9751b36d7':
ape: provide two additional bytes in buffer for old MAC versions
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/apedec.c')
-rw-r--r-- | libavcodec/apedec.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c index 5949bebd72..c45e5d9690 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -916,11 +916,13 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data, av_log(avctx, AV_LOG_WARNING, "packet size is not a multiple of 4. " "extra bytes at the end will be skipped.\n"); } - + if (s->fileversion < 3950) // previous versions overread two bytes + buf_size += 2; av_fast_malloc(&s->data, &s->data_size, buf_size); if (!s->data) return AVERROR(ENOMEM); s->dsp.bswap_buf((uint32_t*)s->data, (const uint32_t*)buf, buf_size >> 2); + memset(s->data + (buf_size & ~3), 0, buf_size & 3); s->ptr = s->data; s->data_end = s->data + buf_size; |