1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-29 16:23:10 +02:00

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>
This commit is contained in:
Michael Niedermayer 2013-01-23 05:09:43 +01:00
parent e49c2aab80
commit 713dea584b

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