projects
/
platform
/
upstream
/
gstreamer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e272ae2
)
pad: Add a guard against getrange functions not filling a caller-provided buffer
author
Sebastian Dröge
<sebastian@centricular.com>
Thu, 2 Apr 2020 10:45:48 +0000
(13:45 +0300)
committer
Sebastian Dröge
<sebastian@centricular.com>
Thu, 2 Apr 2020 10:47:37 +0000
(13:47 +0300)
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.
gst/gstpad.c
patch
|
blob
|
history
diff --git
a/gst/gstpad.c
b/gst/gstpad.c
index
456bf37
..
0d43108
100644
(file)
--- a/
gst/gstpad.c
+++ b/
gst/gstpad.c
@@
-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;