mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avcodec/motionpixels: use av_fast_padded_malloc()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
7fd7a10efd
commit
62ef736f5a
@ -275,13 +275,12 @@ static int mp_decode_frame(AVCodecContext *avctx,
|
||||
return ret;
|
||||
|
||||
/* le32 bitstream msb first */
|
||||
av_fast_malloc(&mp->bswapbuf, &mp->bswapbuf_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
av_fast_padded_malloc(&mp->bswapbuf, &mp->bswapbuf_size, buf_size);
|
||||
if (!mp->bswapbuf)
|
||||
return AVERROR(ENOMEM);
|
||||
mp->dsp.bswap_buf((uint32_t *)mp->bswapbuf, (const uint32_t *)buf, buf_size / 4);
|
||||
if (buf_size & 3)
|
||||
memcpy(mp->bswapbuf + (buf_size & ~3), buf + (buf_size & ~3), buf_size & 3);
|
||||
memset(mp->bswapbuf + buf_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
init_get_bits(&gb, mp->bswapbuf, buf_size * 8);
|
||||
|
||||
memset(mp->changes_map, 0, avctx->width * avctx->height);
|
||||
|
Loading…
x
Reference in New Issue
Block a user