From: Juha-Pekka Heikkila Date: Sat, 16 Apr 2016 19:26:22 +0000 (+0300) Subject: meta: Avoid random memory access on error X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=51632d6f27860c4e217a34fbb23864dfa56c4c48;p=mesa.git 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 --- 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;