diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-04-08 22:39:47 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-04-08 23:12:26 +0200 |
commit | 2daf580284d0ca4e43030c0cf3f6e5a604233f7d (patch) | |
tree | dc62fca10d09b1914d7677d7d2260ef2d8f2ec00 | |
parent | 8ff061095f155269470e1b969a5eb8f6cb2007a7 (diff) | |
download | ffmpeg-2daf580284d0ca4e43030c0cf3f6e5a604233f7d.tar.gz |
avcodec/j2kenc: use av_malloc(z)_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/j2kenc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c index 498c7c022c..ddb0b686cb 100644 --- a/libavcodec/j2kenc.c +++ b/libavcodec/j2kenc.c @@ -343,14 +343,14 @@ static int init_tiles(Jpeg2000EncoderContext *s) s->numXtiles = ff_jpeg2000_ceildiv(s->width, s->tile_width); s->numYtiles = ff_jpeg2000_ceildiv(s->height, s->tile_height); - s->tile = av_malloc(s->numXtiles * s->numYtiles * sizeof(Jpeg2000Tile)); + s->tile = av_malloc_array(s->numXtiles, s->numYtiles * sizeof(Jpeg2000Tile)); if (!s->tile) return AVERROR(ENOMEM); for (tileno = 0, tiley = 0; tiley < s->numYtiles; tiley++) for (tilex = 0; tilex < s->numXtiles; tilex++, tileno++){ Jpeg2000Tile *tile = s->tile + tileno; - tile->comp = av_mallocz(s->ncomponents * sizeof(Jpeg2000Component)); + tile->comp = av_mallocz_array(s->ncomponents, sizeof(Jpeg2000Component)); if (!tile->comp) return AVERROR(ENOMEM); for (compno = 0; compno < s->ncomponents; compno++){ |