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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Douglas Paul <doug@xxxxxxxx>
---
 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

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]