From 2276e0028ffd99e428dc171986548a283f32a7a6 Mon Sep 17 00:00:00 2001 From: Ari Koivula Date: Tue, 5 May 2015 10:39:29 +0300 Subject: [PATCH] Fix coverity warning. - False positive about use of an uninitialized value. Actually just copying uninitialized data from one struct to another. --- src/encoderstate.c | 3 --- src/sao.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/encoderstate.c b/src/encoderstate.c index 9070b142..32b675ee 100644 --- a/src/encoderstate.c +++ b/src/encoderstate.c @@ -246,9 +246,6 @@ static void encoder_state_worker_encode_lcu(void * opaque) { sao_info_t *sao_top_chroma = lcu->position.y != 0 ? &frame->sao_chroma[(lcu->position.y - 1) * stride + lcu->position.x] : NULL; sao_info_t *sao_left_chroma = lcu->position.x != 0 ? &frame->sao_chroma[lcu->position.y * stride + lcu->position.x - 1] : NULL; - init_sao_info(sao_luma); - init_sao_info(sao_chroma); - sao_search_luma(state, frame, lcu->position.x, lcu->position.y, sao_luma, sao_top_luma, sao_left_luma, merge_cost_luma); sao_search_chroma(state, frame, lcu->position.x, lcu->position.y, sao_chroma, sao_top_chroma, sao_left_chroma, merge_cost_chroma); diff --git a/src/sao.c b/src/sao.c index 240a8683..5556b8ca 100644 --- a/src/sao.c +++ b/src/sao.c @@ -727,6 +727,9 @@ static void sao_search_best_mode(const encoder_state_t * const state, const pixe { sao_info_t edge_sao; sao_info_t band_sao; + + init_sao_info(&edge_sao); + init_sao_info(&band_sao); //Avoid "random" uninitialized value edge_sao.band_position[0] = edge_sao.band_position[1] = 0;