summaryrefslogtreecommitdiff
path: root/libavcodec/motionpixels.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-23 15:51:56 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-04-23 15:52:28 +0200
commit7de2cea8a9eac61e4a328da397e3e1c3d0e56278 (patch)
tree87bd7256ecc12b53011c99e577d4a31fdf0f9a8b /libavcodec/motionpixels.c
parentc161134035a08f7454c68fa12c882917015bf65f (diff)
avcodec/motionpixels: use av_mallocz_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/motionpixels.c')
-rw-r--r--libavcodec/motionpixels.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c
index 089909a4d8..13d4759ae6 100644
--- a/libavcodec/motionpixels.c
+++ b/libavcodec/motionpixels.c
@@ -77,10 +77,10 @@ static av_cold int mp_decode_init(AVCodecContext *avctx)
motionpixels_tableinit();
mp->avctx = avctx;
ff_dsputil_init(&mp->dsp, avctx);
- mp->changes_map = av_mallocz(avctx->width * h4);
+ mp->changes_map = av_mallocz_array(avctx->width, h4);
mp->offset_bits_len = av_log2(avctx->width * avctx->height) + 1;
- mp->vpt = av_mallocz(avctx->height * sizeof(YuvPixel));
- mp->hpt = av_mallocz(h4 * w4 / 16 * sizeof(YuvPixel));
+ mp->vpt = av_mallocz_array(avctx->height, sizeof(YuvPixel));
+ mp->hpt = av_mallocz_array(h4 / 4, w4 / 4 * sizeof(YuvPixel));
if (!mp->changes_map || !mp->vpt || !mp->hpt) {
av_freep(&mp->changes_map);
av_freep(&mp->vpt);