[PATCH] wined3d: Zero-initialize count.

Huw Davies huw at codeweavers.com
Wed Mar 15 11:50:19 CDT 2017


This prevents the loop below accessing beyond multisample_types
if the GL_NUM_SAMPLE_COUNTS call fails.

Signed-off-by: Huw Davies <huw at codeweavers.com>
---
 dlls/wined3d/utils.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index f22c314572..d22a68a484 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -2803,6 +2803,7 @@ static void query_internal_format(struct wined3d_adapter *adapter,
     {
         if (gl_info->supported[ARB_INTERNALFORMAT_QUERY])
         {
+            count = 0;
             GL_EXTCALL(glGetInternalformativ(GL_RENDERBUFFER, format->glInternal,
                     GL_NUM_SAMPLE_COUNTS, 1, &count));
             checkGLcall("glGetInternalformativ(GL_NUM_SAMPLE_COUNTS)");
-- 
2.12.0




More information about the wine-patches mailing list