From 38a06d0a33a3f36bca1b765e73ee383e689687ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 26 Jan 2015 09:22:23 +0000 Subject: [PATCH] videoaggregator: fix crash when receiving buffer without timestamps Unset out buffer in clip function when we unref the buffer to be clipped, otherwise aggregator will continue to use the already- freed buffer. Fixes crash when buffers without timestamps are being fed to aggregator. Partly because aggregator ignores the error flow return. https://bugzilla.gnome.org/show_bug.cgi?id=743334 --- gst-libs/gst/video/gstvideoaggregator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/video/gstvideoaggregator.c b/gst-libs/gst/video/gstvideoaggregator.c index e850b6f7bb..005edcaa7b 100644 --- a/gst-libs/gst/video/gstvideoaggregator.c +++ b/gst-libs/gst/video/gstvideoaggregator.c @@ -1512,8 +1512,9 @@ gst_videoaggregator_sink_clip (GstAggregator * agg, start_time = GST_BUFFER_TIMESTAMP (buf); if (start_time == -1) { - GST_DEBUG_OBJECT (pad, "Timestamped buffers required!"); + GST_WARNING_OBJECT (pad, "Timestamped buffers required!"); gst_buffer_unref (buf); + *outbuf = NULL; return GST_FLOW_ERROR; }