From c6746b709c5cf0e3264776c09e994d95f379710b Mon Sep 17 00:00:00 2001 From: Marko Viitanen Date: Tue, 18 May 2021 16:27:07 +0300 Subject: [PATCH] [LMCS] Use calloc for lmcs_aps, makes it behave deterministic --- src/encoderstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/encoderstate.c b/src/encoderstate.c index 66b5410a..b4747dd0 100644 --- a/src/encoderstate.c +++ b/src/encoderstate.c @@ -1346,7 +1346,7 @@ static void encoder_set_source_picture(encoder_state_t * const state, kvz_pictur if (state->encoder_control->cfg.lmcs_enable) { state->tile->frame->source_lmcs = kvz_image_alloc(state->encoder_control->chroma_format, frame->width, frame->height); state->tile->frame->rec_lmcs = kvz_image_alloc(state->encoder_control->chroma_format, frame->width, frame->height); - state->tile->frame->lmcs_aps = malloc(sizeof(lmcs_aps)); + state->tile->frame->lmcs_aps = calloc(1, sizeof(lmcs_aps)); kvz_init_lmcs_aps(state->tile->frame->lmcs_aps, state->encoder_control->cfg.width, state->encoder_control->cfg.height, LCU_CU_WIDTH, LCU_CU_WIDTH, state->encoder_control->bitdepth); }