From 6b259abc02d7243b3c64e1de074af48f92757151 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Wed, 17 Apr 2013 10:53:03 +0200 Subject: [PATCH] vaapipostproc: fix reference counting buf for passthrough mode. Fix reference counting bug for passthrough mode, whereby the input buffer was propagated as is downstream through gst_pad_push() without increasing its reference count before. The was a problem when gst_pad_push() returns an error and we further decrease the reference count of the input buffer. --- gst/vaapi/gstvaapipostproc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gst/vaapi/gstvaapipostproc.c b/gst/vaapi/gstvaapipostproc.c index 28a9cc3..5f1df4c 100644 --- a/gst/vaapi/gstvaapipostproc.c +++ b/gst/vaapi/gstvaapipostproc.c @@ -258,10 +258,13 @@ gst_vaapipostproc_process(GstVaapiPostproc *postproc, GstBuffer *buf) /* Deinterlacing disabled, push frame */ if (!postproc->deinterlace) { - gst_vaapi_video_meta_set_render_flags(meta, flags); - ret = gst_pad_push(postproc->srcpad, buf); + outbuf = gst_buffer_ref(buf); + if (!outbuf) + goto error_create_buffer; + ret = gst_pad_push(postproc->srcpad, outbuf); if (ret != GST_FLOW_OK) goto error_push_buffer; + gst_buffer_unref(buf); return GST_FLOW_OK; } -- 2.7.4