malloc. yeah.
Derek Foreman manmower@gmail.com
1 files changed,
4 insertions(+),
1 deletions(-)
jump to
M
render/render.c
→
render/render.c
@@ -177,7 +177,10 @@ spc->pixel_data = NULL;
break; } copy->textures = orig->textures; - memcpy(copy->texture, orig->texture, orig->textures * sizeof(Texture)); + if (orig->textures) { + copy->texture = malloc(orig->textures * sizeof(Texture)); + memcpy(copy->texture, orig->texture, orig->textures * sizeof(Texture)); + } else copy->texture = NULL; copy->pixmap = None; copy->xftdraw = NULL; return copy;