From 52764e140e89729f88d27b7965f9b9b6658e1cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 22 Dec 2022 20:57:22 +0200 Subject: [PATCH] gtk4: Don't try to use GL mapped video frames as raw RGB memory This will fail badly because the memory pointers are actually GL texture IDs, however this case can't really happen in practice so simply assert on this. Part-of: --- video/gtk4/src/sink/frame.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/video/gtk4/src/sink/frame.rs b/video/gtk4/src/sink/frame.rs index 430150ae..d6eefbe1 100644 --- a/video/gtk4/src/sink/frame.rs +++ b/video/gtk4/src/sink/frame.rs @@ -156,6 +156,10 @@ impl Frame { gst_ctx, ) } else { + // This will fail badly if the video frame was actually mapped as GL texture + // but this case can't really happen as we only do that if we actually have a + // GDK GL context. + assert!(self.gst_context.is_none()); video_frame_to_memory_texture(self.frame, cached_textures, &mut used_textures) } }