mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-14 19:47:03 +00:00
Protect against invalid buffers being bound to GL
* Should fix a reported crash - it looks like an invalid buffer ID was passed, and there's no protection for this. * As with other invalid API use, RenderDoc isn't intended to be totally safe against bad API use. This check is easy to add though and should catch some simple cases.
This commit is contained in:
@@ -233,6 +233,13 @@ void WrappedOpenGL::glBindBuffer(GLenum target, GLuint buffer)
|
||||
GLResourceRecord *r = cd.m_BufferRecord[idx] =
|
||||
GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
|
||||
|
||||
if(!r)
|
||||
{
|
||||
RDCERR("Invalid/unrecognised buffer passed: glBindBuffer(%s, %u)", ToStr::Get(target).c_str(),
|
||||
buffer);
|
||||
return;
|
||||
}
|
||||
|
||||
// it's legal to re-type buffers, generate another BindBuffer chunk to rename
|
||||
if(r->datatype != target)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user