Browse Source

Merge pull request #65475 from timothyqiu/bounds-check

Fix crash when executing `VisualShaderNodeParticleMeshEmitter.set_mesh` with headless Godot
Rémi Verschelde 3 năm trước cách đây
mục cha
commit
22b599819a
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      servers/rendering/dummy/storage/mesh_storage.h

+ 1 - 0
servers/rendering/dummy/storage/mesh_storage.h

@@ -99,6 +99,7 @@ public:
 	virtual RS::SurfaceData mesh_get_surface(RID p_mesh, int p_surface) const override {
 		DummyMesh *m = mesh_owner.get_or_null(p_mesh);
 		ERR_FAIL_COND_V(!m, RS::SurfaceData());
+		ERR_FAIL_INDEX_V(p_surface, m->surfaces.size(), RS::SurfaceData());
 		RS::SurfaceData s = m->surfaces[p_surface];
 		return s;
 	}