gdiplus: Avoid uninitialized usage of bitmap (Coverity).

This commit is contained in:
Marcus Meissner 2012-09-03 18:56:47 +02:00 committed by Alexandre Julliard
parent fcc3a77ae5
commit 5ae8629fca
1 changed files with 12 additions and 10 deletions

View File

@ -3124,17 +3124,19 @@ static GpStatus decode_image_wic(IStream* stream, REFCLSID clsid, UINT active_fr
IWICBitmapSource_Release(source);
}
bitmap->metadata_reader = NULL;
if (IWICBitmapFrameDecode_QueryInterface(frame, &IID_IWICMetadataBlockReader, (void **)&block_reader) == S_OK)
{
UINT block_count = 0;
if (IWICMetadataBlockReader_GetCount(block_reader, &block_count) == S_OK && block_count)
IWICMetadataBlockReader_GetReaderByIndex(block_reader, 0, &bitmap->metadata_reader);
IWICMetadataBlockReader_Release(block_reader);
}
if (SUCCEEDED(hr)) {
bitmap->metadata_reader = NULL;
if (IWICBitmapFrameDecode_QueryInterface(frame, &IID_IWICMetadataBlockReader, (void **)&block_reader) == S_OK)
{
UINT block_count = 0;
if (IWICMetadataBlockReader_GetCount(block_reader, &block_count) == S_OK && block_count)
IWICMetadataBlockReader_GetReaderByIndex(block_reader, 0, &bitmap->metadata_reader);
IWICMetadataBlockReader_Release(block_reader);
}
palette = get_palette(frame, palette_type);
IWICBitmapFrameDecode_Release(frame);
palette = get_palette(frame, palette_type);
IWICBitmapFrameDecode_Release(frame);
}
}
IWICBitmapDecoder_Release(decoder);