diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2021-10-18 22:58:38 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2021-10-18 22:58:38 +0800 |
commit | 2200544141d215e09c86de5672daf5a767302151 (patch) | |
tree | 57d9a74df5a49a003a8f06dc96d516a2d61630b7 | |
parent | ba24e29334f6f3fcd5393e9dda167926862e7e5f (diff) |
Validate enum range in RendererViewport::viewport_get_render_info
-rw-r--r-- | servers/rendering/renderer_viewport.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/servers/rendering/renderer_viewport.cpp b/servers/rendering/renderer_viewport.cpp index b67b1cd806..835d552fd4 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); |