vulkan: early return if gst_buffer_pool_set_config() fails

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6013>
This commit is contained in:
Víctor Manuel Jáquez Leal 2024-01-18 18:35:21 +01:00 committed by GStreamer Marge Bot
parent e7803d1582
commit 394aaa6a59
3 changed files with 12 additions and 3 deletions

View file

@ -169,7 +169,10 @@ _image_to_raw_perform (gpointer impl, GstBuffer * inbuf, GstBuffer ** outbuf)
config = gst_buffer_pool_get_config (raw->pool);
gst_buffer_pool_config_set_params (config, raw->download->out_caps, size,
min, max);
gst_buffer_pool_set_config (raw->pool, config);
if (!gst_buffer_pool_set_config (raw->pool, config)) {
gst_clear_object (&raw->pool);
return GST_FLOW_ERROR;
}
}
if (!raw->pool_active) {
gst_buffer_pool_set_active (raw->pool, TRUE);

View file

@ -1397,7 +1397,10 @@ gst_vulkan_upload_decide_allocation (GstBaseTransform * bt, GstQuery * query)
gst_buffer_pool_config_set_params (config, caps, size, min, max);
gst_buffer_pool_set_config (pool, config);
if (!gst_buffer_pool_set_config (pool, config)) {
gst_object_unref (pool);
return TRUE;
}
if (update_pool)
gst_query_set_nth_allocation_pool (query, 0, pool, size, min, max);

View file

@ -248,7 +248,10 @@ gst_vulkan_video_filter_decide_allocation (GstBaseTransform * bt,
gst_buffer_pool_config_set_params (config, caps, size, min, max);
gst_buffer_pool_set_config (pool, config);
if (!gst_buffer_pool_set_config (pool, config)) {
gst_object_unref (pool);
return FALSE;
}
if (update_pool)
gst_query_set_nth_allocation_pool (query, 0, pool, size, min, max);