camerabinpreview: fix potential crash on preview pipeline error
authorTim-Philipp Müller <tim@centricular.com>
Tue, 28 Jul 2020 10:27:37 +0000 (11:27 +0100)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 28 Jul 2020 13:14:24 +0000 (13:14 +0000)
Post error message on actual element, not the allocated helper struct.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1474>

gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.c

index 60c38f0..2a46490 100644 (file)
@@ -56,7 +56,7 @@ bus_callback (GstBus * bus, GstMessage * message, gpointer user_data)
       g_error_free (err);
 
       /* TODO Not sure if we should post an Error or Warning here */
-      GST_ELEMENT_ERROR (data, CORE, FAILED,
+      GST_ELEMENT_ERROR (data->element, CORE, FAILED,
           ("fatal error in preview pipeline, disposing the pipeline"), (NULL));
 
       /* Possible error situations: