mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-19 05:45:58 +00:00
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.
This commit is contained in:
parent
89f202ea2e
commit
0815899121
1 changed files with 5 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue