Browse Source

truemotion2: use av_mallocz()

Fixes use of uninitialized values.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.2
Michael Niedermayer 12 years ago
parent
commit
713dea584b
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      libavcodec/truemotion2.c

+ 6
- 6
libavcodec/truemotion2.c View File

@@ -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 ||


Loading…
Cancel
Save