pad: Add a guard against getrange functions not filling a caller-provided buffer

It's a programming error to not do so and would cause all kinds of
problems in the caller that assumed its own buffer to have been filled.
This commit is contained in:
Sebastian Dröge 2020-04-02 13:45:48 +03:00
parent e272ae281f
commit 606a9acd74

View file

@ -4878,6 +4878,10 @@ probed_data:
GST_PAD_STREAM_UNLOCK (pad);
/* If the caller provided a buffer it must be filled by the getrange
* function instead of it returning a new buffer */
g_return_val_if_fail (!*buffer || res_buf == *buffer, GST_FLOW_ERROR);
*buffer = res_buf;
return ret;