vkencoder-private: check for codec buffer

gst_vulkan_video_codec_buffer_new() can return NULL, so it's required to check
the returned value and bail out if needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
This commit is contained in:
Víctor Manuel Jáquez Leal 2024-12-03 15:39:47 +01:00 committed by GStreamer Marge Bot
parent d9e9d2ff72
commit 75a6ddf2be

View file

@ -414,6 +414,10 @@ gst_vulkan_encoder_picture_init (GstVulkanEncoderPicture * pic,
pic->out_buffer =
gst_vulkan_video_codec_buffer_new (self->queue->device, &priv->profile,
VK_BUFFER_USAGE_VIDEO_ENCODE_DST_BIT_KHR, size_aligned);
if (!pic->out_buffer) {
gst_clear_buffer (&pic->dpb_buffer);
return FALSE;
}
pic->slotIndex = -1;
pic->offset = 0;