mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +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:
parent
e49c2aab80
commit
713dea584b
@ -934,15 +934,15 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
|
|
||||||
w += 8;
|
w += 8;
|
||||||
h += 8;
|
h += 8;
|
||||||
l->Y1_base = av_malloc(sizeof(*l->Y1_base) * w * h);
|
l->Y1_base = av_mallocz(sizeof(*l->Y1_base) * w * h);
|
||||||
l->Y2_base = av_malloc(sizeof(*l->Y2_base) * w * h);
|
l->Y2_base = av_mallocz(sizeof(*l->Y2_base) * w * h);
|
||||||
l->y_stride = w;
|
l->y_stride = w;
|
||||||
w = (w + 1) >> 1;
|
w = (w + 1) >> 1;
|
||||||
h = (h + 1) >> 1;
|
h = (h + 1) >> 1;
|
||||||
l->U1_base = av_malloc(sizeof(*l->U1_base) * w * h);
|
l->U1_base = av_mallocz(sizeof(*l->U1_base) * w * h);
|
||||||
l->V1_base = av_malloc(sizeof(*l->V1_base) * w * h);
|
l->V1_base = av_mallocz(sizeof(*l->V1_base) * w * h);
|
||||||
l->U2_base = av_malloc(sizeof(*l->U2_base) * w * h);
|
l->U2_base = av_mallocz(sizeof(*l->U2_base) * w * h);
|
||||||
l->V2_base = av_malloc(sizeof(*l->V1_base) * w * h);
|
l->V2_base = av_mallocz(sizeof(*l->V1_base) * w * h);
|
||||||
l->uv_stride = w;
|
l->uv_stride = w;
|
||||||
l->cur = 0;
|
l->cur = 0;
|
||||||
if (!l->Y1_base || !l->Y2_base || !l->U1_base ||
|
if (!l->Y1_base || !l->Y2_base || !l->U1_base ||
|
||||||
|
Loading…
Reference in New Issue
Block a user