mesa: add missing return in error path
authorEric Engestrom <eric.engestrom@intel.com>
Mon, 18 Jun 2018 10:39:05 +0000 (11:39 +0100)
committerEric Engestrom <eric.engestrom@intel.com>
Mon, 18 Jun 2018 15:19:48 +0000 (16:19 +0100)
Fixes: 67f40dadaa6666dacd90 "mesa: add support for ARB_sample_locations"
Cc: Rhys Perry <pendingchaos02@gmail.com>
Cc: Brian Paul <brianp@vmware.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/mesa/main/fbobject.c

index 5d7e5d29847dcfdbb23ea9dfc0f88fe579fc603b..fa7a9361dfcfeaa105aa40ec56397fd7438bd05a 100644 (file)
@@ -4695,9 +4695,11 @@ sample_locations(struct gl_context *ctx, struct gl_framebuffer *fb,
    if (!fb->SampleLocationTable) {
       size_t size = MAX_SAMPLE_LOCATION_TABLE_SIZE * 2 * sizeof(GLfloat);
       fb->SampleLocationTable = malloc(size);
-      if (!fb->SampleLocationTable)
+      if (!fb->SampleLocationTable) {
          _mesa_error(ctx, GL_OUT_OF_MEMORY,
                      "Cannot allocate sample location table");
+         return;
+      }
       for (i = 0; i < MAX_SAMPLE_LOCATION_TABLE_SIZE * 2; i++)
          fb->SampleLocationTable[i] = 0.5f;
    }