[Spice-commits] server/video-stream.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Mar 18 10:42:25 UTC 2019


 server/video-stream.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 116ff8ca897be521110b4804ae24447f6328cde1
Author: Douglas Paul <doug at bogon.ca>
Date:   Sat Mar 9 08:04:33 2019 -0500

    video-stream: prevent crash on stream reattach
    
    I experienced some crashes with qemu 3.1.0 compiled with libspice-server
    0.14.0 on Gentoo.
    
    The problem reproduced reliably with a guest running Ubuntu 18.04.2 LTS.
    If I connect a viewer at system startup, I would get a crash just after
    the fade-in of the login prompt in GDM.
    
    Interestingly, I usually was unable to reproduce the issue if I waited
    to connect until after the greeter was fully displayed.
    
    The patch I used to correct the issue for me applies to the master
    branch cleanly, so I suspect the problem may still exist.
    
    The only other references to this issue I could find were two abrt
    reports in CentOS:
    https://bugs.centos.org/view.php?id=15171
    https://bugs.centos.org/view.php?id=15441
    
    I'm not sure if the agent->video_encoder is supposed to be guaranteed to
    exist when this function is called.
    
    Signed-off-by: Douglas Paul <doug at bogon.ca>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

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);
+            }
         }
     }
 }


More information about the Spice-commits mailing list