mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 17:50:11 +01:00
mesa: Check for framebuffer completeness before looking at the rb.
Otherwise, an incomplete framebuffer could have a NULL _ColorReadBuffer and we'd deref that. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
8b7ba92605
commit
5a827d9a2b
1 changed files with 6 additions and 6 deletions
|
|
@ -701,6 +701,12 @@ _mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height,
|
|||
return;
|
||||
}
|
||||
|
||||
if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
|
||||
_mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
|
||||
"glReadPixels(incomplete framebuffer)" );
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check that the destination format and source buffer are both
|
||||
* integer-valued or both non-integer-valued.
|
||||
*/
|
||||
|
|
@ -715,12 +721,6 @@ _mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height,
|
|||
}
|
||||
}
|
||||
|
||||
if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
|
||||
_mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
|
||||
"glReadPixels(incomplete framebuffer)" );
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx->ReadBuffer->Name != 0 && ctx->ReadBuffer->Visual.samples > 0) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(multisample FBO)");
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue