[PATCH 4/5] dlls/quartz: always allocate the whole VIDEOINFO structure

Eric Pouech eric.pouech at gmail.com
Thu Feb 17 04:16:42 CST 2022


this fixes a couple of GCC11 warnings (-Warray-bounds)

Signed-off-by: Eric Pouech <eric.pouech at gmail.com>

---
 dlls/quartz/avidec.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/quartz/avidec.c b/dlls/quartz/avidec.c
index f8660890273..19aec0738c9 100644
--- a/dlls/quartz/avidec.c
+++ b/dlls/quartz/avidec.c
@@ -342,9 +342,9 @@ static HRESULT avi_decompressor_source_get_media_type(struct strmbase_pin *iface
 
     if (index < ARRAY_SIZE(formats))
     {
-        if (!(format = CoTaskMemAlloc(offsetof(VIDEOINFO, dwBitMasks[3]))))
+        if (!(format = CoTaskMemAlloc(sizeof(VIDEOINFO))))
             return E_OUTOFMEMORY;
-        memset(format, 0, offsetof(VIDEOINFO, dwBitMasks[3]));
+        memset(format, 0, sizeof(VIDEOINFO));
 
         format->rcSource = sink_format->rcSource;
         format->rcTarget = sink_format->rcTarget;




More information about the wine-devel mailing list