Mesa (master): mesa/main: Move NULL pointer check.

Rafael Antognolli rantogno at kemper.freedesktop.org
Tue Jun 20 22:12:34 UTC 2017


Module: Mesa
Branch: master
Commit: b3b61211157ab934f1898d3519e7288c1fd89d80
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b3b61211157ab934f1898d3519e7288c1fd89d80

Author: Plamena Manolova <plamena.manolova at intel.com>
Date:   Wed Jun 14 19:33:12 2017 +0300

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 at intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli at intel.com>

---

 src/mesa/main/blit.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/blit.c b/src/mesa/main/blit.c
index bb866b1e09..8bb3ba328a 100644
--- a/src/mesa/main/blit.c
+++ b/src/mesa/main/blit.c
@@ -349,12 +349,6 @@ 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.
@@ -362,6 +356,12 @@ 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);
+
    if (!no_error) {
       const GLbitfield legalMaskBits = (GL_COLOR_BUFFER_BIT |
                                         GL_DEPTH_BUFFER_BIT |




More information about the mesa-commit mailing list