d3d12videosink: Fix crash on set_buffer()

set_buffer() can be called with null buffer

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5895>
This commit is contained in:
Seungha Yang 2024-01-09 20:44:33 +09:00 committed by GStreamer Marge Bot
parent 7f2b4b6b09
commit 6ffed9b3dc

View file

@ -1370,7 +1370,7 @@ gst_d3d12_window_set_buffer (GstD3D12Window * window, GstBuffer * buffer)
auto swapbuf = priv->ctx->swap_buffers[cur_idx];
auto crop_rect = priv->crop_rect;
auto crop_meta = gst_buffer_get_video_crop_meta (buffer);
auto crop_meta = gst_buffer_get_video_crop_meta (priv->ctx->cached_buf);
if (crop_meta) {
crop_rect = CD3DX12_BOX (crop_meta->x, crop_meta->y,
crop_meta->x + crop_meta->width, crop_meta->y + crop_meta->height);