summaryrefslogtreecommitdiff
path: root/libavcodec/vp3.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-05-27 20:28:17 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-05-27 20:42:50 +0200
commit2870617853b5456e6096c8afa99ba4d5f00cb8a5 (patch)
tree375fa082a6e3594c2a98ba3ba91305f4ab526195 /libavcodec/vp3.c
parent0674da997abe1b6c37564ecae88646ac62e43a0d (diff)
avcodec/vp3: use av_mallocz_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vp3.c')
-rw-r--r--libavcodec/vp3.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 95b7994723..77ae0b0c96 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -1659,17 +1659,17 @@ static av_cold int allocate_tables(AVCodecContext *avctx)
c_fragment_count = s->fragment_width[1] * s->fragment_height[1];
s->superblock_coding = av_mallocz(s->superblock_count);
- s->all_fragments = av_mallocz(s->fragment_count * sizeof(Vp3Fragment));
+ s->all_fragments = av_mallocz_array(s->fragment_count, sizeof(Vp3Fragment));
- s->coded_fragment_list[0] = av_mallocz(s->fragment_count * sizeof(int));
+ s->coded_fragment_list[0] = av_mallocz_array(s->fragment_count, sizeof(int));
- s->dct_tokens_base = av_mallocz(64 * s->fragment_count *
- sizeof(*s->dct_tokens_base));
- s->motion_val[0] = av_mallocz(y_fragment_count * sizeof(*s->motion_val[0]));
- s->motion_val[1] = av_mallocz(c_fragment_count * sizeof(*s->motion_val[1]));
+ s->dct_tokens_base = av_mallocz_array(s->fragment_count,
+ 64 * sizeof(*s->dct_tokens_base));
+ s->motion_val[0] = av_mallocz_array(y_fragment_count, sizeof(*s->motion_val[0]));
+ s->motion_val[1] = av_mallocz_array(c_fragment_count, sizeof(*s->motion_val[1]));
/* work out the block mapping tables */
- s->superblock_fragments = av_mallocz(s->superblock_count * 16 * sizeof(int));
+ s->superblock_fragments = av_mallocz_array(s->superblock_count, 16 * sizeof(int));
s->macroblock_coding = av_mallocz(s->macroblock_count + 1);
if (!s->superblock_coding || !s->all_fragments ||