GNOME Bugzilla – Bug 643244
[0.11] gstpad: gst_pad_alloc_buffer(_and_set_caps) take size as gint instead of guint
Last modified: 2011-02-27 20:19:43 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" ...
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.
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?
(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.