From: Piotr Caban Subject: [PATCH 1/2] windowscodecs: Initialize unused part of metadata PROPVARIANT to 0 Message-Id: <54F83A32.3060003@codeweavers.com> Date: Thu, 05 Mar 2015 12:12:50 +0100 Fixes metadata test failures when warn+heap debug channel is enabled. --- dlls/windowscodecs/gifformat.c | 10 +++++----- dlls/windowscodecs/metadatahandler.c | 4 ++-- dlls/windowscodecs/pngformat.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c index 054a749..861920b 100644 --- a/dlls/windowscodecs/gifformat.c +++ b/dlls/windowscodecs/gifformat.c @@ -75,7 +75,7 @@ static HRESULT load_LSD_metadata(IStream *stream, const GUID *vendor, DWORD opti hr = IStream_Read(stream, &lsd_data, sizeof(lsd_data), &bytesread); if (FAILED(hr) || bytesread != sizeof(lsd_data)) return S_OK; - result = HeapAlloc(GetProcessHeap(), 0, sizeof(MetadataItem) * 9); + result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MetadataItem) * 9); if (!result) return E_OUTOFMEMORY; for (i = 0; i < 9; i++) @@ -180,7 +180,7 @@ static HRESULT load_IMD_metadata(IStream *stream, const GUID *vendor, DWORD opti hr = IStream_Read(stream, &imd_data, sizeof(imd_data), &bytesread); if (FAILED(hr) || bytesread != sizeof(imd_data)) return S_OK; - result = HeapAlloc(GetProcessHeap(), 0, sizeof(MetadataItem) * 8); + result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MetadataItem) * 8); if (!result) return E_OUTOFMEMORY; for (i = 0; i < 8; i++) @@ -273,7 +273,7 @@ static HRESULT load_GCE_metadata(IStream *stream, const GUID *vendor, DWORD opti hr = IStream_Read(stream, &gce_data, sizeof(gce_data), &bytesread); if (FAILED(hr) || bytesread != sizeof(gce_data)) return S_OK; - result = HeapAlloc(GetProcessHeap(), 0, sizeof(MetadataItem) * 5); + result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MetadataItem) * 5); if (!result) return E_OUTOFMEMORY; for (i = 0; i < 5; i++) @@ -388,7 +388,7 @@ static HRESULT load_APE_metadata(IStream *stream, const GUID *vendor, DWORD opti data_size += subblock_size + 1; } - result = HeapAlloc(GetProcessHeap(), 0, sizeof(MetadataItem) * 2); + result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MetadataItem) * 2); if (!result) { HeapFree(GetProcessHeap(), 0, data); @@ -493,7 +493,7 @@ static HRESULT load_GifComment_metadata(IStream *stream, const GUID *vendor, DWO data[data_size] = 0; - result = HeapAlloc(GetProcessHeap(), 0, sizeof(MetadataItem)); + result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MetadataItem)); if (!result) { HeapFree(GetProcessHeap(), 0, data); diff --git a/dlls/windowscodecs/metadatahandler.c b/dlls/windowscodecs/metadatahandler.c index 32ac247..fb35f80 100644 --- a/dlls/windowscodecs/metadatahandler.c +++ b/dlls/windowscodecs/metadatahandler.c @@ -696,7 +696,7 @@ static HRESULT LoadUnknownMetadata(IStream *input, const GUID *preferred_vendor, return hr; } - result = HeapAlloc(GetProcessHeap(), 0, sizeof(MetadataItem)); + result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MetadataItem)); if (!result) { HeapFree(GetProcessHeap(), 0, data); @@ -1126,7 +1126,7 @@ static HRESULT LoadIfdMetadata(IStream *input, const GUID *preferred_vendor, return WINCODEC_ERR_BADMETADATAHEADER; } - result = HeapAlloc(GetProcessHeap(), 0, count * sizeof(*result)); + result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, count * sizeof(*result)); if (!result) { HeapFree(GetProcessHeap(), 0, entry); diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c index b3e6cc6..59b1976 100644 --- a/dlls/windowscodecs/pngformat.c +++ b/dlls/windowscodecs/pngformat.c @@ -111,7 +111,7 @@ static HRESULT LoadTextMetadata(IStream *stream, const GUID *preferred_vendor, value_len = data_size - name_len - 1; - result = HeapAlloc(GetProcessHeap(), 0, sizeof(MetadataItem)); + result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MetadataItem)); name = HeapAlloc(GetProcessHeap(), 0, name_len + 1); value = HeapAlloc(GetProcessHeap(), 0, value_len + 1); if (!result || !name || !value)