After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 363095 - [BaseTransform] Outputs empty buffers
[BaseTransform] Outputs empty buffers
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.10.11
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Reported: 2006-10-18 09:28 UTC by Edward Hervey
Modified: 2007-03-02 19:02 UTC
See Also:
GNOME target: ---
GNOME version: ---

Don't create output buffer if output size is 0 (875 bytes, patch)
2006-10-18 09:29 UTC, Edward Hervey
none Details | Review
Better patch (765 bytes, patch)
2006-10-18 13:17 UTC, Edward Hervey
none Details | Review
without the bug (768 bytes, patch)
2006-10-18 17:08 UTC, Edward Hervey
committed Details | Review

Description Edward Hervey 2006-10-18 09:28:13 UTC
Currently, BaseTransform based plugins output empty buffers (size=0, data=NULL) when transform_size() returns 0.

This causes many problems in plugins that don't support buffers with NULL data.

Apart from this, it really is a bug, since GstBaseTransform doesn't output the buffer if *out_buf is NULL in gst_base_transform_chain(), but subclasses have no way of returning NULL, so it should be up to GstBaseTransform to properly handle that.

The proposed patch will not allocate an output buffer if the output size is 0.
Comment 1 Edward Hervey 2006-10-18 09:29:03 UTC
Created attachment 74927 [details] [review]
Don't create output buffer if output size is 0
Comment 2 Edward Hervey 2006-10-18 09:29:51 UTC
This patch is not enough though, it requires going through all basetransform based plugins to make sure they don't do anything stupid when given a NULL output buffer.
Comment 3 Edward Hervey 2006-10-18 13:17:31 UTC
Created attachment 74947 [details] [review]
Better patch

This patch in fact calls ::transform() with the empty output buffer, but will not push it.
Comment 4 Edward Hervey 2006-10-18 17:08:41 UTC
Created attachment 74960 [details] [review]
without the bug

previous patch didn't compile (buf != outbuf)
Comment 5 Edward Hervey 2006-10-25 13:42:17 UTC
2006-10-25  Edward Hervey  <>

	* libs/gst/base/gstbasetransform.c: (gst_base_transform_chain):
	Don't push the buffer if it's empty.
	Closes #363095

Comment 6 Wim Taymans 2006-10-27 10:02:25 UTC
reopening, 0 sized buffers are valid, after all.
Comment 7 Jan Schmidt 2007-02-27 17:54:50 UTC
Comment 8 Wim Taymans 2007-03-02 19:02:54 UTC