vrend: Add an assert for allocating the intermediate texture

With the format checks introduced earlier the double free bug reported
in #139 should no longer be possible. Nevertheless, add an assert to
ensure that this is checked.

Closes #139

v2: Update NDEBUG_UNUSED to MAYBE_UNUSED

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
macos/master
Gert Wollny 5 years ago
parent e6add72d5e
commit 164d7587ad
  1. 3
      src/vrend_renderer.c

@ -8385,7 +8385,8 @@ static void vrend_renderer_blit_int(struct vrend_context *ctx,
args.array_size = src_res->base.array_size;
intermediate_copy = (struct vrend_resource *)CALLOC_STRUCT(vrend_texture);
vrend_renderer_resource_copy_args(&args, intermediate_copy);
vrend_renderer_resource_allocate_texture(intermediate_copy, NULL);
MAYBE_UNUSED int r = vrend_renderer_resource_allocate_texture(intermediate_copy, NULL);
assert(!r);
glGenFramebuffers(1, &intermediate_fbo);
} else {

Loading…
Cancel
Save