From 8d7ce380c4445518f7f7423038621986d469d516 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) } }