diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2014-09-12 15:22:19 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2014-09-12 15:22:19 +0300 |
commit | 126c511e6273c3dea7494d81ed044414a3e355ba (patch) | |
tree | e22e25868afa0089895334a6d012eb5337d4fceb /gst | |
parent | 076b83208af17b10d9e0aa6cecc42ad998427e07 (diff) |
pad: Make sure the buffer to get/pull_range() has at least the requested size
https://bugzilla.gnome.org/show_bug.cgi?id=735861
Diffstat (limited to 'gst')
-rw-r--r-- | gst/gstpad.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gst/gstpad.c b/gst/gstpad.c index adb44ffca..e835e2988 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -4419,8 +4419,8 @@ gst_pad_get_range (GstPad * pad, guint64 offset, guint size, g_return_val_if_fail (GST_IS_PAD (pad), GST_FLOW_ERROR); g_return_val_if_fail (GST_PAD_IS_SRC (pad), GST_FLOW_ERROR); g_return_val_if_fail (buffer != NULL, GST_FLOW_ERROR); - g_return_val_if_fail (*buffer == NULL - || GST_IS_BUFFER (*buffer), GST_FLOW_ERROR); + g_return_val_if_fail (*buffer == NULL || (GST_IS_BUFFER (*buffer) + && gst_buffer_get_size (*buffer) >= size), GST_FLOW_ERROR); return gst_pad_get_range_unchecked (pad, offset, size, buffer); } @@ -4474,8 +4474,8 @@ gst_pad_pull_range (GstPad * pad, guint64 offset, guint size, g_return_val_if_fail (GST_IS_PAD (pad), GST_FLOW_ERROR); g_return_val_if_fail (GST_PAD_IS_SINK (pad), GST_FLOW_ERROR); g_return_val_if_fail (buffer != NULL, GST_FLOW_ERROR); - g_return_val_if_fail (*buffer == NULL - || GST_IS_BUFFER (*buffer), GST_FLOW_ERROR); + g_return_val_if_fail (*buffer == NULL || (GST_IS_BUFFER (*buffer) + && gst_buffer_get_size (*buffer) >= size), GST_FLOW_ERROR); GST_OBJECT_LOCK (pad); if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad))) |