Merge "Fixed hang in the case of multiple sps id." into mnc-dev am: 16b019a620 am: 5ecccccbd7 am: 5cf7f81ca3 am: 33fef92f58
am: e0f81b63d0

Change-Id: I4d43f9e9518b900c592b9714e492791337d65ba0
diff --git a/decoder/ih264d_parse_headers.c b/decoder/ih264d_parse_headers.c
index 352d605..d8c37a6 100644
--- a/decoder/ih264d_parse_headers.c
+++ b/decoder/ih264d_parse_headers.c
@@ -564,7 +564,10 @@
     /*--------------------------------------------------------------------*/
 
     ps_seq = ps_dec->pv_scratch_sps_pps;
-    *ps_seq = ps_dec->ps_sps[u1_seq_parameter_set_id];
+    if(ps_dec->i4_header_decoded & 1)
+    {
+        *ps_seq = *ps_dec->ps_cur_sps;
+    }
 
 
     if((ps_dec->i4_header_decoded & 1) && (ps_seq->u1_profile_idc != u1_profile_idc))