Fix ubsan warnings about indexing into null pointers
Ref T99382 Differential Revision: https://developer.blender.org/D15390
This commit is contained in:
committed by
Brecht Van Lommel
parent
a06c9b5ca8
commit
db46251209
@@ -35,9 +35,11 @@ class GLIndexBuf : public IndexBuf {
|
||||
{
|
||||
additional_vertex_offset += index_start_;
|
||||
if (index_type_ == GPU_INDEX_U32) {
|
||||
return (GLuint *)0 + additional_vertex_offset;
|
||||
return reinterpret_cast<void *>(static_cast<intptr_t>(additional_vertex_offset) *
|
||||
sizeof(GLuint));
|
||||
}
|
||||
return (GLushort *)0 + additional_vertex_offset;
|
||||
return reinterpret_cast<void *>(static_cast<intptr_t>(additional_vertex_offset) *
|
||||
sizeof(GLushort));
|
||||
}
|
||||
|
||||
GLuint restart_index() const
|
||||
|
||||
Reference in New Issue
Block a user