Commit e31b1938 authored by Michael Niedermayer's avatar Michael Niedermayer

zmbv: avoid use of uninitialized data

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent c2409a7c
...@@ -493,6 +493,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac ...@@ -493,6 +493,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
c->by = (c->height+ c->bh - 1) / c->bh; c->by = (c->height+ c->bh - 1) / c->bh;
if (!c->cur || !c->prev) if (!c->cur || !c->prev)
return -1; return -1;
memset(c->cur, 0, avctx->width * avctx->height * (c->bpp / 8));
memset(c->prev, 0, avctx->width * avctx->height * (c->bpp / 8));
c->decode_intra= decode_intra; c->decode_intra= decode_intra;
} }
...@@ -633,7 +635,7 @@ static av_cold int decode_init(AVCodecContext *avctx) ...@@ -633,7 +635,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
/* Allocate decompression buffer */ /* Allocate decompression buffer */
if (c->decomp_size) { if (c->decomp_size) {
if ((c->decomp_buf = av_malloc(c->decomp_size)) == NULL) { if ((c->decomp_buf = av_mallocz(c->decomp_size)) == NULL) {
av_log(avctx, AV_LOG_ERROR, av_log(avctx, AV_LOG_ERROR,
"Can't allocate decompression buffer.\n"); "Can't allocate decompression buffer.\n");
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment