Browse Source

avcodec/vc2enc: Clear coef_buf on allocation

Fixes: Use of uninitialized memory
Fixes: assertion failure

Reviewed-by: <atomnuker>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6d00905f81)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.0.10
Michael Niedermayer 8 years ago
parent
commit
4171249d76
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/vc2enc.c

+ 1
- 1
libavcodec/vc2enc.c View File

@@ -1088,7 +1088,7 @@ static av_cold int vc2_encode_init(AVCodecContext *avctx)
p->dwt_width = w = FFALIGN(p->width, (1 << s->wavelet_depth));
p->dwt_height = h = FFALIGN(p->height, (1 << s->wavelet_depth));
p->coef_stride = FFALIGN(p->dwt_width, 32);
p->coef_buf = av_malloc(p->coef_stride*p->dwt_height*sizeof(dwtcoef));
p->coef_buf = av_mallocz(p->coef_stride*p->dwt_height*sizeof(dwtcoef));
if (!p->coef_buf)
goto alloc_fail;
for (level = s->wavelet_depth-1; level >= 0; level--) {


Loading…
Cancel
Save