decoder: Return error if first slice decoded in a frame is dependent slice

Dependent slice copies slice header from a previously decoded slice.
In case of errors, when the first slice is missing and subsequent slice to
be decoded is a dependent slice, it has no valid slice header to copy
from. Ignore such slices.

Bug: 141688974
Test: poc in bug
Change-Id: Idc1bed45ab37aeee4d373deb00e1b465ca84cfeb
(cherry picked from commit 40dbcab01b)
This commit is contained in:
Harish Mahendrakar 2019-10-02 11:12:13 -07:00 • committed by Ray Essick
parent 75d1ac1026
commit ae695cd67e

View file

@ -325,6 +325,12 @@ IHEVCD_ERROR_T ihevcd_parse_slice_header(codec_t *ps_codec,
{
BITS_PARSE("dependent_slice_flag", value, ps_bitstrm, 1);
/* First slice to be decoded in the current picture can't be dependent slice */
if (value && 0 == ps_codec->i4_pic_present)
{
return IHEVCD_IGNORE_SLICE;
}
/* If dependendent slice, copy slice header from previous slice */
if(value && (ps_codec->s_parse.i4_cur_slice_idx > 0))
{