avcodec/motionpixels: use av_fast_padded_malloc()

Signed-off-by: Paul B Mahol <onemda@gmail.com>
pull/45/head
Paul B Mahol 11 years ago
parent 7fd7a10efd
commit 62ef736f5a
  1. 3
      libavcodec/motionpixels.c

@ -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…
Cancel
Save