mesa/main: Move NULL pointer check.

In blit_framebuffer we're already doing a NULL
pointer check for readFb and drawFb so it makes
sense to do it before we actually use the pointers.

CID: 1412569
Signed-off-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
(cherry picked from commit b3b6121115)
[Andres Gomez: resolve trivial conflicts]
Signed-off-by: Andres Gomez <agomez@igalia.com>
This commit is contained in:
Plamena Manolova 2017-06-14 19:33:12 +03:00 committed by Andres Gomez
parent 1d4d3f88c6
commit e9f0179221

View file

@ -191,12 +191,6 @@ _mesa_blit_framebuffer(struct gl_context *ctx,
FLUSH_VERTICES(ctx, 0);
/* Update completeness status of readFb and drawFb. */
_mesa_update_framebuffer(ctx, readFb, drawFb);
/* Make sure drawFb has an initialized bounding box. */
_mesa_update_draw_buffer_bounds(ctx, drawFb);
if (!readFb || !drawFb) {
/* This will normally never happen but someday we may want to
* support MakeCurrent() with no drawables.
@ -204,6 +198,12 @@ _mesa_blit_framebuffer(struct gl_context *ctx,
return;
}
/* Update completeness status of readFb and drawFb. */
_mesa_update_framebuffer(ctx, readFb, drawFb);
/* Make sure drawFb has an initialized bounding box. */
_mesa_update_draw_buffer_bounds(ctx, drawFb);
/* check for complete framebuffers */
if (drawFb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT ||
readFb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {