From 2ca545f754acc9c8a00b5ce8c0b3ca1175c74a3a Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Thu, 30 Jan 2025 03:21:59 +0500 Subject: fix: temp fix for "access violation" exception --- src/editor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/editor.c b/src/editor.c index 8193a52..d445ad3 100644 --- a/src/editor.c +++ b/src/editor.c @@ -54,7 +54,9 @@ void SE_UpdateEditor(Editor *editor) { if (layers[selectedLayer] == NULL || selectedLayer >= cache->layerCount) { cache->layerCount++; - EditorTileLayer *layer = malloc(sizeof(EditorTileLayer)); + // TODO: allocate memory based on active tiles. + // remove 1000 and you will get "access violation" + EditorTileLayer *layer = malloc(sizeof(EditorTileLayer) * 1000); layer->index = selectedLayer; layer->tilesCount = 0; -- cgit v1.2.3