Range coder in 3.90-3.95 overread two bytes in the final normalize.
Unified · Split
| @@ -917,11 +917,13 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data, · 916 unmodified lines | |||
| 917 | av_log(avctx, AV_LOG_WARNING, "packet size is not a multiple of 4. " | 917 | av_log(avctx, AV_LOG_WARNING, "packet size is not a multiple of 4. " |
| 918 | "extra bytes at the end will be skipped.\n"); | 918 | "extra bytes at the end will be skipped.\n"); |
| 919 | } | 919 | } |
| 920 | 920 | if (s->fileversion < 3950) // previous versions overread two bytes | |
| 921 | buf_size += 2; | ||
| 921 | av_fast_malloc(&s->data, &s->data_size, buf_size); | 922 | av_fast_malloc(&s->data, &s->data_size, buf_size); |
| 922 | if (!s->data) | 923 | if (!s->data) |
| 923 | return AVERROR(ENOMEM); | 924 | return AVERROR(ENOMEM); |
| 924 | s->dsp.bswap_buf((uint32_t*)s->data, (const uint32_t*)buf, buf_size >> 2); | 925 | s->dsp.bswap_buf((uint32_t*)s->data, (const uint32_t*)buf, buf_size >> 2); |
| 926 | memset(s->data + (buf_size & ~3), 0, buf_size & 3); | ||
| 925 | s->ptr = s->data; | 927 | s->ptr = s->data; |
| 926 | s->data_end = s->data + buf_size; | 928 | s->data_end = s->data + buf_size; |
| 927 | 929 | ||