From 361059ed3cfd9fd8f839b5d73fe0e6f611ff3521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 17 May 2017 17:24:25 +0800 Subject: [PATCH] gstpinossrc: Don't crash when format is changed to NULL --- pinos/gst/gstpinossrc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pinos/gst/gstpinossrc.c b/pinos/gst/gstpinossrc.c index 8389802c8..74a09de9c 100644 --- a/pinos/gst/gstpinossrc.c +++ b/pinos/gst/gstpinossrc.c @@ -786,6 +786,9 @@ on_format_changed (PinosListener *listener, gboolean res; PinosContext *ctx = stream->context; + if (!format) + return; + caps = gst_caps_from_format (format); GST_DEBUG_OBJECT (pinossrc, "we got format %" GST_PTR_FORMAT, caps); res = gst_base_src_set_caps (GST_BASE_SRC (pinossrc), caps);