OSDN Git Service

mesa/main: Move NULL pointer check.
authorPlamena Manolova <plamena.manolova@intel.com>
Wed, 14 Jun 2017 16:33:12 +0000 (19:33 +0300)
committerAndres Gomez <agomez@igalia.com>
Wed, 12 Jul 2017 16:32:08 +0000 (19:32 +0300)
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 b3b61211157ab934f1898d3519e7288c1fd89d80)
[Andres Gomez: resolve trivial conflicts]
Signed-off-by: Andres Gomez <agomez@igalia.com>
src/mesa/main/blit.c

index e739130..b41a21f 100644 (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) {