GNOME Bugzilla – Bug 706162
gst_buffer_memcmp() ignores the buffer size if it goes past the gstbuffer
Last modified: 2013-08-20 18:42:13 UTC
Created attachment 251936 [details] [review] buffer: Fix gst_buffer_memcmp() where the buffer is smaller If the arguments to gst_buffer_memcmp() go past the end of the gstbuffer, the gst_buffer_memcmp() returns 0, while it should probably return that the buffers are not equal.
Or maybe the caller should check and it should be regarded as a programming error?
In that case, we may want to add a g_return_val_if_fail() in there
I think the function should first check the sizes and return -1/1 if it doesn't match.
Yeah, checking sizes in the very beginning before doing anything else and then returning not-0 immediately sounds best to me too.
Created attachment 252275 [details] [review] buffer: Fix gst_buffer_memcmp() where the buffer is smaller than size Alternate patch that checks the size first.
Review of attachment 252275 [details] [review]: Looks good, ship it :)
Committed commit f90f3cde5f165daa99b9756eba4b98bc26aa1362 Author: Olivier Crête <olivier.crete@collabora.com> Date: Mon Aug 19 14:55:22 2013 -0400 buffer: Fix gst_buffer_memcmp() where the buffer is smaller than size Also add unit tests for gst_buffer_memcmp https://bugzilla.gnome.org/show_bug.cgi?id=706162