renderer: report error on invalid surface

Instead of later crashing.

Fix found thanks to american fuzzy lop.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
macos/master
Marc-André Lureau 9 years ago committed by Dave Airlie
parent b079de618e
commit f58e985a63
  1. 5
      src/vrend_renderer.c

@ -1530,7 +1530,10 @@ void vrend_set_framebuffer_state(struct vrend_context *ctx,
break; break;
} }
} }
assert(surf); if (surf == NULL) {
report_context_error(ctx, VIRGL_ERROR_CTX_ILLEGAL_SURFACE, i);
return;
}
new_height = u_minify(surf->texture->base.height0, surf->val0); new_height = u_minify(surf->texture->base.height0, surf->val0);
new_ibf = surf->texture->y_0_top ? true : false; new_ibf = surf->texture->y_0_top ? true : false;
} }

Loading…
Cancel
Save