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

Fix r_glsl_dumpshader segfault #147

Conversation

hemebond
Copy link
Contributor

Fixed #145 by changing dupe variable back from unsigned int to int.

@bones-was-here
Copy link
Contributor

Good catch, in 05bc755 I should have changed only i to unsigned (needed to prevent a warning), didn't notice that dupe is counting backwards. Rereading it now, the rest of that commit looks OK.

I think mode should also be changed back to signed because its initial value is 0 so with it unsigned, mode - 1 gives 4294967295u, when this is cast back to signed for initialising dupe signed overflow occurs (though it gives the desired result of -1 on typical CPUs).
For language it doesn't matter if it's signed or unsigned.

In 05bc755 only i should have been
changed to unsigned to prevent the warning.

Fixes DarkPlacesEngine#145

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
@bones-was-here bones-was-here merged commit 678c43a into DarkPlacesEngine:master Apr 1, 2024
1 check passed
@hemebond hemebond deleted the fix/r-glsl-dumpshader-segfault branch April 14, 2024 12:30
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

Successfully merging this pull request may close these issues.

Segmentation fault when using r_glsl_dumpshader
2 participants