[Mesa-dev] [PATCH 1/2] meta: Avoid random memory access on error

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Sat Apr 16 19:26:22 UTC 2016


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 <juhapekka.heikkila at gmail.com>
---
 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 9402a46..ebea428 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;
-- 
1.9.1



More information about the mesa-dev mailing list