libs/gst/base/gstbasetransform.c: Clear the output buffer variable.

Original commit message from CVS:
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_prepare_output_buffer),
(gst_base_transform_getrange):
Clear the output buffer variable.
Cleanups to the error path in the getrange function.
Fixes #557649.
This commit is contained in:
Wim Taymans 2008-10-24 09:41:19 +00:00
parent 5357a24dbf
commit 8d871b9c1d
2 changed files with 26 additions and 5 deletions

View file

@ -1,3 +1,12 @@
2008-10-24 Wim Taymans <wim.taymans@collabora.co.uk>
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_prepare_output_buffer),
(gst_base_transform_getrange):
Clear the output buffer variable.
Cleanups to the error path in the getrange function.
Fixes #557649.
2008-10-23 Sebastian Dröge <slomo@circular-chaos.org> 2008-10-23 Sebastian Dröge <slomo@circular-chaos.org>
* plugins/elements/gstfdsrc.c: (gst_fd_src_create): * plugins/elements/gstfdsrc.c: (gst_fd_src_create):

View file

@ -1074,6 +1074,8 @@ gst_base_transform_prepare_output_buffer (GstBaseTransform * trans,
priv = trans->priv; priv = trans->priv;
*out_buf = NULL;
/* figure out how to allocate a buffer based on the current configuration */ /* figure out how to allocate a buffer based on the current configuration */
if (trans->passthrough) { if (trans->passthrough) {
GST_DEBUG_OBJECT (trans, "doing passthrough alloc"); GST_DEBUG_OBJECT (trans, "doing passthrough alloc");
@ -1863,15 +1865,25 @@ gst_base_transform_getrange (GstPad * pad, guint64 offset,
trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad)); trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad));
ret = gst_pad_pull_range (trans->sinkpad, offset, length, &inbuf); ret = gst_pad_pull_range (trans->sinkpad, offset, length, &inbuf);
if (ret == GST_FLOW_OK) { if (G_UNLIKELY (ret != GST_FLOW_OK))
GST_BASE_TRANSFORM_LOCK (trans); goto pull_error;
ret = gst_base_transform_handle_buffer (trans, inbuf, buffer);
GST_BASE_TRANSFORM_UNLOCK (trans);
}
GST_BASE_TRANSFORM_LOCK (trans);
ret = gst_base_transform_handle_buffer (trans, inbuf, buffer);
GST_BASE_TRANSFORM_UNLOCK (trans);
done:
gst_object_unref (trans); gst_object_unref (trans);
return ret; return ret;
/* ERRORS */
pull_error:
{
GST_DEBUG_OBJECT (trans, "failed to pull a buffer: %s",
gst_flow_get_name (ret));
goto done;
}
} }
static GstFlowReturn static GstFlowReturn