From 53e4d1a007f101edbb4321d2eafb88444e18f7ed Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 16 May 2011 18:48:20 +0200 Subject: [PATCH] basetransform: fix buffer refcounting When we fail to allocate an output buffer, set the buffer pointer to NULL or else the calling function will try to unref it. Remove some old comments --- libs/gst/base/gstbasetransform.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index 62a69c8..0654507 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -1781,9 +1781,7 @@ no_reconfigure: no_qos: /* first try to allocate an output buffer based on the currently negotiated - * format. While we call pad-alloc we could renegotiate the srcpad format or - * have a new suggestion for upstream buffer-alloc. - * In any case, outbuf will contain a buffer suitable for doing the configured + * format. outbuf will contain a buffer suitable for doing the configured * transform after this function. */ ret = gst_base_transform_prepare_output_buffer (trans, inbuf, outbuf); if (G_UNLIKELY (ret != GST_FLOW_OK)) @@ -1852,6 +1850,7 @@ not_negotiated: no_buffer: { gst_buffer_unref (inbuf); + *outbuf = NULL; GST_WARNING_OBJECT (trans, "could not get buffer from pool: %s", gst_flow_get_name (ret)); return ret; -- 2.7.4