summaryrefslogtreecommitdiff
path: root/servers/visual/visual_server_canvas.h
diff options
context:
space:
mode:
authorHein-Pieter van Braam-Stewart <hp@tmm.cx>2019-04-22 15:20:21 +0200
committerHein-Pieter van Braam-Stewart <hp@tmm.cx>2019-04-22 15:27:10 +0200
commitc52f8906266cc9d95b8f609f5e14d4a17e130f94 (patch)
tree9fe29ad48a77c4b1f0387258702c8ed24c5abc5c /servers/visual/visual_server_canvas.h
parent886afa9b7692bc263cf96c03882760521b74b942 (diff)
Don't try to statically allocate 2x 8193 pointers
Maximum stack size is only 8KiB, this will try to allocate 8193 * sizeof(void*) * 2 = 131088 bytes on the stack. This causes a crash in some cases.
Diffstat (limited to 'servers/visual/visual_server_canvas.h')
-rw-r--r--servers/visual/visual_server_canvas.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/servers/visual/visual_server_canvas.h b/servers/visual/visual_server_canvas.h
index 7691d68639..4e99bb3676 100644
--- a/servers/visual/visual_server_canvas.h
+++ b/servers/visual/visual_server_canvas.h
@@ -160,6 +160,9 @@ private:
void _render_canvas_item(Item *p_canvas_item, const Transform2D &p_transform, const Rect2 &p_clip_rect, const Color &p_modulate, int p_z, RasterizerCanvas::Item **z_list, RasterizerCanvas::Item **z_last_list, Item *p_canvas_clip, Item *p_material_owner);
void _light_mask_canvas_items(int p_z, RasterizerCanvas::Item *p_canvas_item, RasterizerCanvas::Light *p_masked_lights);
+ RasterizerCanvas::Item **z_list;
+ RasterizerCanvas::Item **z_last_list;
+
public:
void render_canvas(Canvas *p_canvas, const Transform2D &p_transform, RasterizerCanvas::Light *p_lights, RasterizerCanvas::Light *p_masked_lights, const Rect2 &p_clip_rect);
@@ -254,6 +257,7 @@ public:
bool free(RID p_rid);
VisualServerCanvas();
+ ~VisualServerCanvas();
};
#endif // VISUALSERVERCANVAS_H