From 2200544141d215e09c86de5672daf5a767302151 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Mon, 18 Oct 2021 22:58:38 +0800 Subject: [PATCH] Validate enum range in RendererViewport::viewport_get_render_info --- servers/rendering/renderer_viewport.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/servers/rendering/renderer_viewport.cpp b/servers/rendering/renderer_viewport.cpp index b67b1cd8061..835d552fd41 100644 --- a/servers/rendering/renderer_viewport.cpp +++ b/servers/rendering/renderer_viewport.cpp @@ -1012,6 +1012,7 @@ void RendererViewport::viewport_set_lod_threshold(RID p_viewport, float p_pixels } int RendererViewport::viewport_get_render_info(RID p_viewport, RS::ViewportRenderInfoType p_type, RS::ViewportRenderInfo p_info) { + ERR_FAIL_INDEX_V(p_type, RS::VIEWPORT_RENDER_INFO_TYPE_MAX, -1); ERR_FAIL_INDEX_V(p_info, RS::VIEWPORT_RENDER_INFO_MAX, -1); Viewport *viewport = viewport_owner.get_or_null(p_viewport);