From: David Woodhouse Date: Sun, 5 Apr 2020 23:04:14 +0000 (+0100) Subject: Cope with screen==NULL in screen_appsink_new_sample() X-Git-Tag: v1.4~10 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ceee47d7b186b250fc6fc6625ae4adb1305773b0;p=pidgin-chime.git Cope with screen==NULL in screen_appsink_new_sample() I saw a crash with this once, in a long sequence of sharing from A to B and then B to A testing screen sharing startup/teardown. It looksl like a race condition when we change to the no_appsink_callbacks but the callback is already in progress, and the cbdata gets set to NULL. --- diff --git a/chime/chime-call-screen.c b/chime/chime-call-screen.c index b038a43..939fc24 100644 --- a/chime/chime-call-screen.c +++ b/chime/chime-call-screen.c @@ -379,6 +379,9 @@ static GstFlowReturn screen_appsink_new_sample(GstAppSink* self, gpointer data) if (!sample) return GST_FLOW_OK; + if (!screen) + return GST_FLOW_ERROR; + if (screen->state == CHIME_SCREEN_STATE_SENDING && screen->viewer_present) { GstBuffer *buffer = gst_sample_get_buffer(sample); gsize len = gst_buffer_get_size(buffer);