Browse Source

Merge commit '9652d4fcfc9c07a726b35efc4ac644d9751b36d7'

* commit '9652d4fcfc9c07a726b35efc4ac644d9751b36d7':
  ape: provide two additional bytes in buffer for old MAC versions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.0
Michael Niedermayer 12 years ago
parent
commit
5be70f5826
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavcodec/apedec.c

+ 3
- 1
libavcodec/apedec.c View File

@@ -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;



Loading…
Cancel
Save