Immediate-Mode-UI / Nuklear

A single-header ANSI C immediate mode cross-platform GUI library
https://immediate-mode-ui.github.io/Nuklear/doc/index.html
Other
9.06k stars 542 forks source link

Fixed UBSan trip in GLFW OpenGL3 demo backend #518

Closed Th3T3chn0G1t closed 1 year ago

Th3T3chn0G1t commented 1 year ago

Addressing #516

This resolves a false UBSan trip caused by treating the element offset in glDrawElements as a pointer This parameter is effectively an offset but is taken as a void*. By not storing the offset as a pointer, UBSan no longer tools the offset to check for null pointer overflow.

OpenGL has a tendency to take offsets which are applied on the GPU as pointers, but they are just offsets so it's perfectly fine to do this.