[PATCH 2/5] msacm32: Allocate correct struct size on Win64 (GCC 11).

Rémi Bernon rbernon at codeweavers.com
Mon Sep 27 03:58:30 CDT 2021


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/msacm32/driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/msacm32/driver.c b/dlls/msacm32/driver.c
index a8d6f3cf6d7..1be3b522241 100644
--- a/dlls/msacm32/driver.c
+++ b/dlls/msacm32/driver.c
@@ -429,7 +429,7 @@ LRESULT WINAPI acmDriverMessage(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARA
                  * reports a 16-byte structure to codecs, so allocate 16 bytes,
                  * just to be on the safe side.
                  */
-                const unsigned int iStructSize = 16;
+                const unsigned int iStructSize = max(16, sizeof(*pConfigInfo));
                 pConfigInfo = HeapAlloc(MSACM_hHeap, 0, iStructSize);
                 if (!pConfigInfo) {
                     ERR("OOM while supplying DRVCONFIGINFO for DRV_CONFIGURE, using NULL\n");
-- 
2.33.0




More information about the wine-devel mailing list