From 54cbe1b29b35e8bd8ebbaed2b5eeacfeecca98cc Mon Sep 17 00:00:00 2001 From: Harish Mahendrakar Date: Mon, 5 Dec 2016 12:24:09 +0530 Subject: [PATCH] Decoder: Fix initialization of ps_next_dpb during reference list creation ps_dpb_mgr->ps_dpb_ht_head is a linked list with ps_dpb_mgr->u1_num_lt_ref_bufs number of valid buffers. So ps_next_dbp has to be initialized to ps_dpb_mgr->ps_dpb_ht_head for each u1_lt_index loop iteration Bug: 33387820 Change-Id: I2dfd962bad5640a829afc123adbd0709e563e621 --- decoder/ih264d_process_bslice.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/decoder/ih264d_process_bslice.c b/decoder/ih264d_process_bslice.c index 69199cf..4c5ee05 100644 --- a/decoder/ih264d_process_bslice.c +++ b/decoder/ih264d_process_bslice.c @@ -1465,10 +1465,11 @@ void ih264d_init_ref_idx_lx_b(dec_struct_t *ps_dec) /* 2.3 Arrange all Long term buffers in ascending order, in LongtermIndex */ /* Start from ST head */ u1_num_short_term_bufs = u1_L1; - ps_next_dpb = ps_dpb_mgr->ps_dpb_ht_head; + for(u1_lt_index = u1_min_lt_index; u1_lt_index <= u1_max_lt_index; u1_lt_index++) { + ps_next_dpb = ps_dpb_mgr->ps_dpb_ht_head; for(i = 0; i < ps_dpb_mgr->u1_num_lt_ref_bufs; i++) { if(ps_next_dpb->u1_lt_idx == u1_lt_index)