summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-01-24 11:55:22 +0100
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-01-24 11:55:22 +0100
commit08158991214c36169d517110065eb51efd7ffdba (patch)
tree5c373e3a433cebd491a035901586c5c34002b1ba
parent89f202ea2ec9d72d46aa0ee7f077f71e0eb290d6 (diff)
vaapivideobufferpool: validate returned meta
Validate if the meta returned by gst_buffer_get_vaapi_video_meta() in the acquired buffer is not null. This situation should be very "pathological", but still it is better be safe since that meta might be used later to create a new dma buffer.
-rw-r--r--gst/vaapi/gstvaapivideobufferpool.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gst/vaapi/gstvaapivideobufferpool.c b/gst/vaapi/gstvaapivideobufferpool.c
index b9e43866..f01773e4 100644
--- a/gst/vaapi/gstvaapivideobufferpool.c
+++ b/gst/vaapi/gstvaapivideobufferpool.c
@@ -440,8 +440,11 @@ gst_vaapi_video_buffer_pool_acquire_buffer (GstBufferPool * pool,
/* Update the underlying surface proxy */
meta = gst_buffer_get_vaapi_video_meta (buffer);
- if (meta)
- gst_vaapi_video_meta_set_surface_proxy (meta, priv_params->proxy);
+ if (!meta) {
+ *out_buffer_ptr = buffer;
+ return GST_FLOW_ERROR;
+ }
+ gst_vaapi_video_meta_set_surface_proxy (meta, priv_params->proxy);
/* Find the cached memory associated with the given surface. */
surface = GST_VAAPI_SURFACE_PROXY_SURFACE (priv_params->proxy);