Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Not allocating enough memory for shader paths #10

Open
OlaviTohver opened this issue Aug 17, 2023 · 0 comments
Open

Bug: Not allocating enough memory for shader paths #10

OlaviTohver opened this issue Aug 17, 2023 · 0 comments

Comments

@OlaviTohver
Copy link

Crashing when using shader that has certain number of characters in its folder name.

How reproduce bug:

  • In Shaders folder rename folder named samples to sample
  • run liveW -p sample alsa_out.pci-0000_00_1b.0.analog-stereo.monitor
  • Fails with error described below:

Fatal glibc error: malloc.c:2593 (sysmalloc): assertion failed: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)

vertPath = (char*)malloc((strlen("Shaders//vert.glsl") + strlen(cfg.shaderName)) * sizeof(char));

FIX: Should be vertPath = (char*)malloc(((strlen("Shaders//vert.glsl") + strlen(shaderName)) * sizeof(char))+1);
fragPath = (char*)malloc((strlen("Shaders//frag.glsl") + strlen(cfg.shaderName)) * sizeof(char));

FIX: Should be fragPath = (char*)malloc(((strlen("Shaders//frag.glsl") + strlen(shaderName)) * sizeof(char))+1);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant