History

ape: provide two additional bytes in buffer for old MAC versions

Range coder in 3.90-3.95 overread two bytes in the final normalize.

Kostya Shishkov committed 13 years ago

Commit 9652d4f1 parent b164d661 file · +3 −1Browse files

Unified · Split

libavcodec/apedec.c+3−1
@@ -917,11 +917,13 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data, · 916 unmodified lines
917917 av_log(avctx, AV_LOG_WARNING, "packet size is not a multiple of 4. "
918918 "extra bytes at the end will be skipped.\n");
919919 }
920−
920+ if (s->fileversion < 3950) // previous versions overread two bytes
921+ buf_size += 2;
921922 av_fast_malloc(&s->data, &s->data_size, buf_size);
922923 if (!s->data)
923924 return AVERROR(ENOMEM);
924925 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);
925927 s->ptr = s->data;
926928 s->data_end = s->data + buf_size;
927929

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t