From 830858436bb31036d4260f30c25fa83fd351ed40 Mon Sep 17 00:00:00 2001 From: Naveen Kumar P Date: Fri, 31 Mar 2017 16:58:15 +0530 Subject: [PATCH] Set current slice ctb x and y to fill prev incomplete slice If previous slice is not completed, update the current slice ctb_x and ctb_y so that while filling the previous slice, the parse slice code can break properly. Bug: 32322258 Test: boot, ran POC supplied with bug Change-Id: Ie9090694514a018268851560a3f056194ff6fc91 --- decoder/ihevcd_parse_slice_header.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/decoder/ihevcd_parse_slice_header.c b/decoder/ihevcd_parse_slice_header.c index 89c32ff..16c1a0b 100644 --- a/decoder/ihevcd_parse_slice_header.c +++ b/decoder/ihevcd_parse_slice_header.c @@ -726,11 +726,15 @@ IHEVCD_ERROR_T ihevcd_parse_slice_header(codec_t *ps_codec, { if(ps_codec->i4_pic_present) { + slice_header_t *ps_slice_hdr_next; ps_codec->i4_slice_error = 1; ps_codec->s_parse.i4_cur_slice_idx--; if(ps_codec->s_parse.i4_cur_slice_idx < 0) ps_codec->s_parse.i4_cur_slice_idx = 0; + ps_slice_hdr_next = ps_codec->s_parse.ps_slice_hdr_base + ((ps_codec->s_parse.i4_cur_slice_idx + 1) & (MAX_SLICE_HDR_CNT - 1)); + ps_slice_hdr_next->i2_ctb_x = slice_address % ps_sps->i2_pic_wd_in_ctb; + ps_slice_hdr_next->i2_ctb_y = slice_address / ps_sps->i2_pic_wd_in_ctb; return ret; } else