h264: CB1 fix h264 crash in h264_slice_header_process. [1/1]

PD#SWPL-193724

Problem:
h264 dec_picture is clear when using.

Solution:
add mutex lock for dec_picture clear.

Verify:
sc2

Change-Id: I3b4e6c374003e5a5c7cf94c43f0875d4969626f2
Signed-off-by: shihong.zheng <shihong.zheng@amlogic.com>
diff --git a/drivers/frame_provider/decoder/h264_multi/vmh264.c b/drivers/frame_provider/decoder/h264_multi/vmh264.c
index 9b589ed..7671867 100644
--- a/drivers/frame_provider/decoder/h264_multi/vmh264.c
+++ b/drivers/frame_provider/decoder/h264_multi/vmh264.c
@@ -7822,7 +7822,9 @@
 				hw->last_dec_picture =
 					p_H264_Dpb->mVideo.dec_picture;
 
+			mutex_lock(&hw->pic_mutex);
 			p_H264_Dpb->mVideo.dec_picture = NULL;
+			mutex_unlock(&hw->pic_mutex);
 
 			/* dump_dpb(&p_H264_Dpb->mDPB); */
 			hw->has_i_frame = 1;
diff --git a/drivers/frame_provider/decoder_v4l/h264_multi/vmh264.c b/drivers/frame_provider/decoder_v4l/h264_multi/vmh264.c
index 7652a8d..98cf086 100644
--- a/drivers/frame_provider/decoder_v4l/h264_multi/vmh264.c
+++ b/drivers/frame_provider/decoder_v4l/h264_multi/vmh264.c
@@ -7355,7 +7355,11 @@
 			bufmgr_post(p_H264_Dpb);
 				hw->last_dec_picture =
 					p_H264_Dpb->mVideo.dec_picture;
+
+			mutex_lock(&hw->pic_mutex);
 			p_H264_Dpb->mVideo.dec_picture = NULL;
+			mutex_unlock(&hw->pic_mutex);
+
 			hw->has_i_frame = 1;
 			if ((hw->mmu_enable) && (hw->dec_result != DEC_RESULT_TIMEOUT))
 				hevc_set_frame_done(hw);