]> www.infradead.org Git - pidgin-chime.git/commitdiff
Cope with screen==NULL in screen_appsink_new_sample()
authorDavid Woodhouse <dwmw@amazon.co.uk>
Sun, 5 Apr 2020 23:04:14 +0000 (00:04 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Sun, 5 Apr 2020 23:04:30 +0000 (00:04 +0100)
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.

chime/chime-call-screen.c

index b038a432b6e5132abf9755b25d56c1df822554cd..939fc243751b412bcc8e086ad95cb25d5f4fef6e 100644 (file)
@@ -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);