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 643244 - [0.11] gstpad: gst_pad_alloc_buffer(_and_set_caps) take size as gint instead of guint
[0.11] gstpad: gst_pad_alloc_buffer(_and_set_caps) take size as gint instead ...
Status: RESOLVED INVALID
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal enhancement
: 0.11.0
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-02-24 23:41 UTC by Leo Singer
Modified: 2011-02-27 20:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (4.88 KB, patch)
2011-02-24 23:41 UTC, Leo Singer
none Details | Review

Description Leo Singer 2011-02-24 23:41:04 UTC
Created attachment 181880 [details] [review]
proposed patch

Elements that use gst_pad_alloc_buffer or gst_pad_alloc_buffer_and_set_caps are not able to allocate buffers larger than INT_MAX because these two functions take the 'size' argument as a signed gint instead of guint.  Other functions that allocate buffers seem to accept the size as a guint.  Here are some examples:

typedef GstFlowReturn (*GstPadBufferAllocFunction) (GstPad *pad, guint64 offset, guint size, GstCaps *caps, GstBuffer **buf);
GstBuffer * gst_buffer_new_and_alloc (guint size);
GstBuffer * gst_buffer_try_new_and_alloc (guint size);

One can do a preliminary search for other places where signedness of size arguments might need to be looked at...

$ cd gstreamer
$ grep -Iir "gint size"
...
Comment 1 Sebastian Dröge (slomo) 2011-02-25 07:39:03 UTC
Not sure if you saw the FIXME 0.11 comment there:
 /* FIXME 0.11: size should be unsigned */


You're of course right, this should be a guint like the size stored in a buffer. Changing this in 0.10 will be API breakage though but we'll definitely do it in 0.11.
Comment 2 Tim-Philipp Müller 2011-02-25 08:58:50 UTC
Do we really need this bug if there's already a FIXME 0.11? Also, please mark 0.11 bugs are enhancements. Lastly, isn't gst_pad_alloc_buffer*() going to disappear soon anyway?
Comment 3 Leo Singer 2011-02-25 09:22:47 UTC
(In reply to comment #1)
> Not sure if you saw the FIXME 0.11 comment there:
>  /* FIXME 0.11: size should be unsigned */
> 

No, I didn't notice the FIXME.  Sorry for creating noise.  You're right, I'm fine with closing this bug.