[Spice-devel] [PATCH spice-server 1/1] video-stream: prevent crash on stream reattach

Douglas Paul doug at bogon.ca
Fri Mar 8 16:21:03 UTC 2019


Check that the video encoder has been created before sending frame
drop notification through it.

Signed-off-by: Douglas Paul <doug at bogon.ca>
---
 server/video-stream.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/server/video-stream.c b/server/video-stream.c
index b624093e..19795098 100644
--- a/server/video-stream.c
+++ b/server/video-stream.c
@@ -369,7 +369,9 @@ static void before_reattach_stream(DisplayChannel *display,
 #ifdef STREAM_STATS
             agent->stats.num_drops_pipe++;
 #endif
-            agent->video_encoder->notify_server_frame_drop(agent->video_encoder);
+            if (agent->video_encoder) {
+                agent->video_encoder->notify_server_frame_drop(agent->video_encoder);
+            }
         }
     }
 }
-- 
2.19.2



More information about the Spice-devel mailing list