buffer: fix guards for gst_buffer_take_memory()

Since idx = -1 makes it default to idx=len, len is also
a valid input idx.
This commit is contained in:
Tim-Philipp Müller 2011-07-06 12:09:28 +01:00
parent 3bb21e0203
commit a1f6e02149

View file

@ -595,7 +595,7 @@ gst_buffer_take_memory (GstBuffer * buffer, guint idx, GstMemory * mem)
g_return_if_fail (GST_IS_BUFFER (buffer)); g_return_if_fail (GST_IS_BUFFER (buffer));
g_return_if_fail (gst_buffer_is_writable (buffer)); g_return_if_fail (gst_buffer_is_writable (buffer));
g_return_if_fail (mem != NULL); g_return_if_fail (mem != NULL);
g_return_if_fail (idx == -1 || idx < GST_BUFFER_MEM_LEN (buffer)); g_return_if_fail (idx == -1 || idx <= GST_BUFFER_MEM_LEN (buffer));
_memory_add (buffer, idx, mem); _memory_add (buffer, idx, mem);
} }