Commit 713dea58 authored by Michael Niedermayer's avatar Michael Niedermayer

truemotion2: use av_mallocz()

Fixes use of uninitialized values.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e49c2aab
......@@ -934,15 +934,15 @@ static av_cold int decode_init(AVCodecContext *avctx)
w += 8;
h += 8;
l->Y1_base = av_malloc(sizeof(*l->Y1_base) * w * h);
l->Y2_base = av_malloc(sizeof(*l->Y2_base) * w * h);
l->Y1_base = av_mallocz(sizeof(*l->Y1_base) * w * h);
l->Y2_base = av_mallocz(sizeof(*l->Y2_base) * w * h);
l->y_stride = w;
w = (w + 1) >> 1;
h = (h + 1) >> 1;
l->U1_base = av_malloc(sizeof(*l->U1_base) * w * h);
l->V1_base = av_malloc(sizeof(*l->V1_base) * w * h);
l->U2_base = av_malloc(sizeof(*l->U2_base) * w * h);
l->V2_base = av_malloc(sizeof(*l->V1_base) * w * h);
l->U1_base = av_mallocz(sizeof(*l->U1_base) * w * h);
l->V1_base = av_mallocz(sizeof(*l->V1_base) * w * h);
l->U2_base = av_mallocz(sizeof(*l->U2_base) * w * h);
l->V2_base = av_mallocz(sizeof(*l->V1_base) * w * h);
l->uv_stride = w;
l->cur = 0;
if (!l->Y1_base || !l->Y2_base || !l->U1_base ||
......
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