From 6524cb0ab274ac02167e6e1856d32d7e87d21514 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Thu, 13 Jun 2024 13:15:44 +0300 Subject: [PATCH] [Core] switch_core_session_write_video_frame: Coverity 1546433 Check of thread-shared field evades lock acquisition --- src/switch_core_media.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index de5d0eff74..04b055e9ff 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -14675,7 +14675,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_video_frame(switch_cor switch_codec_t *codec = switch_core_session_get_video_write_codec(session); switch_timer_t *timer; switch_media_handle_t *smh; - switch_image_t *dup_img = NULL, *img = frame->img; + switch_image_t *dup_img = NULL, *img = NULL; switch_status_t encode_status; switch_frame_t write_frame = {0}; switch_rtp_engine_t *v_engine = NULL; @@ -14736,6 +14736,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_video_frame(switch_cor smh->video_last_key_time = now; } + img = frame->img; + if (!img) { switch_status_t vstatus;