avcodec/apedec: use av_fast_padded_malloc()

Fixes use of uninitialized memory
Fixes part of msan_uninit-mem_7fa0d8c8bd58_8417_sh3.ape
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-12-23 18:09:58 +01:00
parent d5128fce38
commit 99978320c0
1 changed files with 1 additions and 1 deletions

View File

@ -1438,7 +1438,7 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
} }
if (s->fileversion < 3950) // previous versions overread two bytes if (s->fileversion < 3950) // previous versions overread two bytes
buf_size += 2; buf_size += 2;
av_fast_malloc(&s->data, &s->data_size, buf_size); av_fast_padded_malloc(&s->data, &s->data_size, buf_size);
if (!s->data) if (!s->data)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
s->dsp.bswap_buf((uint32_t*)s->data, (const uint32_t*)buf, buf_size >> 2); s->dsp.bswap_buf((uint32_t*)s->data, (const uint32_t*)buf, buf_size >> 2);