Skip to content

Commit

Permalink
Fix bug in pd-vanilla implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyschoen committed Sep 26, 2024
1 parent e3a5acd commit 868250d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ luaflags += -DLUA_USE_WINDOWS
endef
endif

cflags = ${luaflags} -DPDLUA_VERSION="$(pdlua_version)" -fsanitize=address -g
cflags = ${luaflags} -DPDLUA_VERSION="$(pdlua_version)"

pdlua.class.sources := pdlua.c $(luasrc)
pdlua.class.ldlibs := $(lualibs)
Expand Down
4 changes: 3 additions & 1 deletion pdlua_gfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,9 @@ static int start_paint(lua_State* L) {
int layer = luaL_checknumber(L, 2);
if(layer >= gfx->num_layers)
{
gfx->layer_tags = resizebytes(gfx->layer_tags, sizeof(char*) * gfx->num_layers, sizeof(char*) * ++gfx->num_layers);
int new_num_layers = layer + 1;
gfx->layer_tags = resizebytes(gfx->layer_tags, sizeof(char*) * gfx->num_layers, sizeof(char*) * new_num_layers);
gfx->num_layers = new_num_layers;
gfx->layer_tags[layer] = malloc(64);
snprintf(gfx->layer_tags[layer], 64, ".l%i%lx", layer, (long)obj);
}
Expand Down

0 comments on commit 868250d

Please sign in to comment.