[PORT FROM R4.1]fix the messy issue when play the exported video againmainline BZ: 72393

BZ: 72393

root cause:
in the mix parser, the array size of frame store(fs) in struct h264_DecodedPictureBuffer
is 18, but will receive an index 31 to rewrite the entry value, unfortunately, this
behavior will overwrite the member of first_mb_in_slice in h264_Slice_Header_t for struct
h264_DecodedPictureBuffer and h264_Slice_Header_t are members of in the same struct of
h264_Info. The patch add an parameter check to fix the issue.

Change-Id: I6fba249a38673cf9c7af9ea9dc71063f470e01f7
Orig-Change-Id: I784fb6c76693b11a8c14d561755f7f1a92efb946
Signed-off-by: Gu, Wangyi <wangyi.gu@intel.com>
Signed-off-by: hding3 <haitao.ding@intel.com>
Reviewed-on: http://android.intel.com:8080/83610
Reviewed-by: Feng, Wei <wei.feng@intel.com>
Reviewed-by: Shi, PingX <pingx.shi@intel.com>
Tested-by: Shi, PingX <pingx.shi@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Tested-by: cactus <cactus@intel.com>
diff --git a/mix_vbp/viddec_fw/fw/codecs/h264/parser/h264parse.c b/mix_vbp/viddec_fw/fw/codecs/h264/parser/h264parse.c
index e7dd6a7..2efa5c3 100644
--- a/mix_vbp/viddec_fw/fw/codecs/h264/parser/h264parse.c
+++ b/mix_vbp/viddec_fw/fw/codecs/h264/parser/h264parse.c
@@ -675,9 +675,12 @@
     {
         if (pInfo->nal_unit_type == h264_NAL_UNIT_TYPE_IDR)
         {
-            pInfo->dpb.fs[pInfo->dpb.fs_dec_idc].pic_type = (0x1 << FRAME_TYPE_STRUCTRUE_OFFSET)|(FRAME_TYPE_IDR << FRAME_TYPE_FRAME_OFFSET);
+            if (pInfo->dpb.fs_dec_idc < NUM_DPB_FRAME_STORES)
+            {
+                pInfo->dpb.fs[pInfo->dpb.fs_dec_idc].pic_type = (0x1 << FRAME_TYPE_STRUCTRUE_OFFSET)|(FRAME_TYPE_IDR << FRAME_TYPE_FRAME_OFFSET);
             //pInfo->dpb.fs[pInfo->dpb.fs_dec_idc].pic_type = 0xff;
             //pInfo->dpb.fs[0].pic_type = pInfo->dpb.fs_dec_idc;
+            }
 
         }
         else