We want to iterate over items idx to idx + length
We use the len variable as the corrected number of memory to iterate
and then properly go over all items.
Fixes the issue where specifying any idx different from 0 had no effect
Spotted by clang static analyzer
FALSE);
if (length == -1)
- length = len - idx;
+ len -= idx;
+ else
+ len = length;
for (i = 0; i < len; i++) {
- if (!gst_memory_is_writable (GST_BUFFER_MEM_PTR (buffer, i)))
+ if (!gst_memory_is_writable (GST_BUFFER_MEM_PTR (buffer, i + idx)))
return FALSE;
}
return TRUE;