Skip to content

gallium/u_vbuf: avoid dereferencing NULL pointer

Erik Faye-Lund requested to merge kusma/mesa:u_vbuf-null-resource into master

When I last time fixed this, I missed that continuing here would make us leak pointers in the translate state, which is what made this avoid a crash in the first place.

That's not great, we need to set some pointer in this case. The obvious option would be NULL, but that means that the translate-code also needs to support NULL-pointers here.

Instead, let's point to a small, static buffer that contains enough zero-data for the largest possible vertex attribute. This avoids having to add more NULL-checks.

Fixes: a8e8204b ("gallium/u_vbuf: support NULL-resources")

Edited by Erik Faye-Lund

Merge request reports