Merge cherrypicks of [3661626, 3661980, 3662429, 3661545, 3661546, 3661579, 3661580, 3662430, 3661547, 3661548, 3661549, 3661550, 3662578, 3662579, 3662580, 3662581, 3662582, 3662583, 3661597, 3661598, 3661551, 3661552, 3661553, 3661554, 3661555, 3662596, 3662597, 3662598, 3662599, 3662584, 3662585, 3662586, 3662616, 3662617, 3662618] into oc-m4-release

Change-Id: I988af821221e1d60558c7f5dca9f9db5dde153fe
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;