Mesa (master): mesa/main: Fix memset in formatquery.c

Edward O'Callaghan funfunctor at kemper.freedesktop.org
Sun Apr 2 05:18:59 UTC 2017


Module: Mesa
Branch: master
Commit: f9387a223d40bb8d108a539671e0291cc25c6d80
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f9387a223d40bb8d108a539671e0291cc25c6d80

Author: Edward O'Callaghan <funfunctor at folklore1984.net>
Date:   Fri Mar 17 16:24:06 2017 +1100

mesa/main: Fix memset in formatquery.c

v2: We explicitly set each member to -1 over using a confusing
memset().

Signed-off-by: Edward O'Callaghan <funfunctor at folklore1984.net>
Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>
Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/mesa/main/formatquery.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c
index 598d34d347..07fb2f2330 100644
--- a/src/mesa/main/formatquery.c
+++ b/src/mesa/main/formatquery.c
@@ -1564,7 +1564,8 @@ _mesa_GetInternalformati64v(GLenum target, GLenum internalformat,
     * no pname can return a negative value, we fill params32 with negative
     * values as reference values, that can be used to know what copy-back to
     * params */
-   memset(params32, -1, 16);
+   for (i = 0; i < realSize; i++)
+      params32[i] = -1;
 
    /* For GL_MAX_COMBINED_DIMENSIONS we need to get back 2 32-bit integers,
     * and at the same time we only need 2. So for that pname, we call the




More information about the mesa-commit mailing list