[PATCH 4/6] dlls/quartz: use VIDEOINFOHEADER instead of partially allocated VIDEOINFO structure
Eric Pouech
eric.pouech at gmail.com
Mon Feb 14 03:28:18 CST 2022
this fixes a couple of GCC11 warnings (-Wbounds)
Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
---
dlls/quartz/avidec.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/quartz/avidec.c b/dlls/quartz/avidec.c
index f8660890273..1295e8704df 100644
--- a/dlls/quartz/avidec.c
+++ b/dlls/quartz/avidec.c
@@ -331,7 +331,7 @@ static HRESULT avi_decompressor_source_get_media_type(struct strmbase_pin *iface
struct avi_decompressor *filter = impl_from_strmbase_filter(iface->filter);
const VIDEOINFOHEADER *sink_format;
- VIDEOINFO *format;
+ VIDEOINFOHEADER *format;
if (!filter->sink.pin.peer)
return VFW_S_NO_MORE_ITEMS;
@@ -363,9 +363,10 @@ static HRESULT avi_decompressor_source_get_media_type(struct strmbase_pin *iface
if (IsEqualGUID(formats[index].subtype, &MEDIASUBTYPE_RGB565))
{
- format->dwBitMasks[iRED] = 0xf800;
- format->dwBitMasks[iGREEN] = 0x07e0;
- format->dwBitMasks[iBLUE] = 0x001f;
+ DWORD *dwBitMasks = (DWORD *)(format + 1);
+ dwBitMasks[iRED] = 0xf800;
+ dwBitMasks[iGREEN] = 0x07e0;
+ dwBitMasks[iBLUE] = 0x001f;
mt->cbFormat = offsetof(VIDEOINFO, dwBitMasks[3]);
}
else
More information about the wine-devel
mailing list