From 51632d6f27860c4e217a34fbb23864dfa56c4c48 Mon Sep 17 00:00:00 2001 From: Juha-Pekka Heikkila Date: Sat, 16 Apr 2016 22:26:22 +0300 Subject: [PATCH] meta: Avoid random memory access on error Initialize drawFb to NULL in _mesa_meta_CopyImageSubData_uncompressed() if getting readFb fails uninitialized drawFb will cause randomness on cleanup. Signed-off-by: Juha-Pekka Heikkila Reviewed-by: Eduardo Lima Mitev Reviewed-by: Chad Versace --- src/mesa/drivers/common/meta_copy_image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/common/meta_copy_image.c b/src/mesa/drivers/common/meta_copy_image.c index 9402a4652eb..ebea4285c9a 100644 --- a/src/mesa/drivers/common/meta_copy_image.c +++ b/src/mesa/drivers/common/meta_copy_image.c @@ -168,7 +168,7 @@ _mesa_meta_CopyImageSubData_uncompressed(struct gl_context *ctx, GLuint src_view_texture = 0; struct gl_texture_image *src_view_tex_image; struct gl_framebuffer *readFb; - struct gl_framebuffer *drawFb; + struct gl_framebuffer *drawFb = NULL; bool success = false; GLbitfield mask; GLenum status, attachment; -- 2.30.2