summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2019-08-14 11:21:30 -0400
committerTim-Philipp Müller <tim@centricular.com>2019-08-14 22:39:34 +0100
commit0c1639546b3d04a1a2a8ade00c1ed3b4c41c0623 (patch)
tree53281b692591dbf632a1e50a0a19d18332afbe1f /sys
parent58ea39c0be1feaf2734b95e52d8b5f2d4b4fc4b3 (diff)
downloadgstreamer-plugins-bad-0c1639546b3d04a1a2a8ade00c1ed3b4c41c0623.tar.gz
amc: Fix crash when a sync_meta survives its sink
_amc_gl_free() could be called after the GstAmcVideoDec has been finalized, in the case downstream still has a ref to a buffer.
Diffstat (limited to 'sys')
-rw-r--r--sys/androidmedia/gstamcvideodec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/androidmedia/gstamcvideodec.c b/sys/androidmedia/gstamcvideodec.c
index 168165010..6ca6dd2fd 100644
--- a/sys/androidmedia/gstamcvideodec.c
+++ b/sys/androidmedia/gstamcvideodec.c
@@ -153,6 +153,7 @@ _gl_sync_unref (struct gl_sync *sync)
_gl_sync_result_unref (sync->result);
+ g_object_unref (sync->sink);
g_object_unref (sync->surface);
gst_memory_unref ((GstMemory *) sync->oes_mem);
@@ -1464,7 +1465,7 @@ retry:
sync = g_new0 (struct gl_sync, 1);
sync->refcount = 1;
- sync->sink = self;
+ sync->sink = g_object_ref (self);
sync->buffer = outbuf;
sync->surface = g_object_ref (self->surface);
sync->oes_mem =