screen-cast/stream-src: Assert that dmabuf handle lookup succeeds

To prevent issues like the one fixed in the previous commit.

Also remove a redundant variable assignment.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3326>
This commit is contained in:
Robert Mader 2023-10-13 18:29:19 +02:00 committed by Marge Bot
parent 5809ef62f5
commit 8d3d8b86e5

View File

@ -564,11 +564,11 @@ meta_screen_cast_stream_src_calculate_stride (MetaScreenCastStreamSrc *src,
if (spa_data->type == SPA_DATA_DmaBuf)
{
CoglDmaBufHandle *dmabuf_handle = NULL;
CoglDmaBufHandle *dmabuf_handle;
dmabuf_handle = g_hash_table_lookup (priv->dmabuf_handles,
GINT_TO_POINTER (spa_data->fd));
if (dmabuf_handle)
g_assert (dmabuf_handle != NULL);
return cogl_dma_buf_handle_get_stride (dmabuf_handle);
}