diff options
author | Paul B Mahol <onemda@gmail.com> | 2013-05-17 16:48:03 +0400 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2013-05-21 21:49:29 +0400 |
commit | dbb49a653971131e011eaca332741e5299a0a375 (patch) | |
tree | 6ed5ab14d837f699fef290ec142c3852467f9b19 /libavcodec/vp3.c | |
parent | 66f5790d7bc22a3cd1b3b266a8c22bd51c65a05c (diff) |
vp3: zero allocated tables
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/vp3.c')
-rw-r--r-- | libavcodec/vp3.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 5bf2feed58..fe4e48ba9d 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -1632,16 +1632,16 @@ static av_cold int allocate_tables(AVCodecContext *avctx) y_fragment_count = s->fragment_width[0] * s->fragment_height[0]; c_fragment_count = s->fragment_width[1] * s->fragment_height[1]; - s->superblock_coding = av_malloc(s->superblock_count); - s->all_fragments = av_malloc(s->fragment_count * sizeof(Vp3Fragment)); - s->coded_fragment_list[0] = av_malloc(s->fragment_count * sizeof(int)); - s->dct_tokens_base = av_malloc(64*s->fragment_count * sizeof(*s->dct_tokens_base)); - s->motion_val[0] = av_malloc(y_fragment_count * sizeof(*s->motion_val[0])); - s->motion_val[1] = av_malloc(c_fragment_count * sizeof(*s->motion_val[1])); + s->superblock_coding = av_mallocz(s->superblock_count); + s->all_fragments = av_mallocz(s->fragment_count * sizeof(Vp3Fragment)); + s->coded_fragment_list[0] = av_mallocz(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])); /* work out the block mapping tables */ - s->superblock_fragments = av_malloc(s->superblock_count * 16 * sizeof(int)); - s->macroblock_coding = av_malloc(s->macroblock_count + 1); + s->superblock_fragments = av_mallocz(s->superblock_count * 16 * sizeof(int)); + s->macroblock_coding = av_mallocz(s->macroblock_count + 1); if (!s->superblock_coding || !s->all_fragments || !s->dct_tokens_base || !s->coded_fragment_list[0] || !s->superblock_fragments || !s->macroblock_coding || |