Handle invalid frame fd when creating EGL image (#36743)

catch
This commit is contained in:
Maxime Desroches
2025-12-01 21:32:07 -08:00
committed by GitHub
parent 62b7abcd91
commit 65e551c671
+6 -2
View File
@@ -128,8 +128,12 @@ def init_egl() -> bool:
def create_egl_image(width: int, height: int, stride: int, fd: int, uv_offset: int) -> EGLImage | None:
assert _egl.initialized, "EGL not initialized"
# Duplicate fd since EGL needs it
dup_fd = os.dup(fd)
try:
# Duplicate fd since EGL needs it
dup_fd = os.dup(fd)
except OSError as e:
cloudlog.exception(f"Failed to duplicate frame fd when creating EGL image: {e}")
return None
# Create image attributes for EGL
img_attrs = [