Merge cherrypicks of [3628718, 3628929, 3628848, 3628813, 3628719, 3628980, 3628930, 3628931, 3628903, 3628759, 3629000, 3629001, 3629002, 3629003, 3629040, 3629041, 3629042, 3629043, 3629044, 3629045, 3628974, 3629022, 3628981, 3628849, 3628932, 3628933, 3628934, 3628935, 3628936, 3628937, 3628938, 3628939, 3629060, 3628982, 3628983, 3628984] into oc-m5-release

Change-Id: Ic1a94e928ec0025bed7b0acfc8a9e528fe7cf8c5
diff --git a/decoder/ih264d_parse_headers.c b/decoder/ih264d_parse_headers.c
index f0d0d88..03ed508 100644
--- a/decoder/ih264d_parse_headers.c
+++ b/decoder/ih264d_parse_headers.c
@@ -30,6 +30,8 @@
  * \author  AI
  **************************************************************************
  */
+#include <string.h>
+
 #include "ih264_typedefs.h"
 #include "ih264_macros.h"
 #include "ih264_platform_macros.h"
@@ -564,6 +566,8 @@
     /*--------------------------------------------------------------------*/
 
     ps_seq = ps_dec->pv_scratch_sps_pps;
+    memset(ps_seq, 0, sizeof(dec_seq_params_t));
+
     if(ps_dec->i4_header_decoded & 1)
     {
         *ps_seq = *ps_dec->ps_cur_sps;
diff --git a/decoder/ih264d_parse_slice.c b/decoder/ih264d_parse_slice.c
index 609c2fe..db02bfe 100644
--- a/decoder/ih264d_parse_slice.c
+++ b/decoder/ih264d_parse_slice.c
@@ -1826,7 +1826,7 @@
         ps_dec->ps_cur_pic->u4_pack_slc_typ |= I_SLC_BIT;
 
         ret = ih264d_parse_islice(ps_dec, u2_first_mb_in_slice);
-
+        ps_dec->u1_pr_sl_type = u1_slice_type;
         if(ps_dec->i4_pic_type != B_SLICE && ps_dec->i4_pic_type != P_SLICE)
             ps_dec->i4_pic_type = I_SLICE;