diff --git a/ChangeLog b/ChangeLog index 1af9cb94d4..2d4607136e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-10-24 Wim Taymans + + * 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 * plugins/elements/gstfdsrc.c: (gst_fd_src_create): diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index 83bee54f37..cc61e27d2e 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -1074,6 +1074,8 @@ gst_base_transform_prepare_output_buffer (GstBaseTransform * trans, priv = trans->priv; + *out_buf = NULL; + /* figure out how to allocate a buffer based on the current configuration */ if (trans->passthrough) { 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)); ret = gst_pad_pull_range (trans->sinkpad, offset, length, &inbuf); - if (ret == GST_FLOW_OK) { - GST_BASE_TRANSFORM_LOCK (trans); - ret = gst_base_transform_handle_buffer (trans, inbuf, buffer); - GST_BASE_TRANSFORM_UNLOCK (trans); - } + if (G_UNLIKELY (ret != GST_FLOW_OK)) + goto pull_error; + GST_BASE_TRANSFORM_LOCK (trans); + ret = gst_base_transform_handle_buffer (trans, inbuf, buffer); + GST_BASE_TRANSFORM_UNLOCK (trans); + +done: gst_object_unref (trans); return ret; + + /* ERRORS */ +pull_error: + { + GST_DEBUG_OBJECT (trans, "failed to pull a buffer: %s", + gst_flow_get_name (ret)); + goto done; + } } static GstFlowReturn