From 92f29b97038ba686fe298b55681802b9ef8de73d Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 15 Jul 2014 16:25:23 +0530 Subject: appsink: Fix a rare crash --- src/main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.c b/src/main.c index b0a102c..44b3201 100644 --- a/src/main.c +++ b/src/main.c @@ -121,6 +121,13 @@ invoke_write_client_chunk (TranscodeClientCtx *ctx) gboolean eos; stp_print_status ("*"); + + /* XXX: If samples are coming in too quickly, this can get invoked + * after the client has disconnected and the SoupMessage is invalid + * So, we check if the msg is still a msg before trying to append. */ + if (G_UNLIKELY (!SOUP_IS_MESSAGE (ctx->msg))) + return FALSE; + g_signal_emit_by_name (ctx->appsink, "pull-sample", &sample); if (!sample) { g_debug ("Null sample, ending stream"); -- cgit v0.11.2-2-gd1dd