From ed5c3621a533589fde614ba8d8a07a82c054ad25 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Mon, 8 Mar 2010 16:42:36 -0600 Subject: [PATCH 09/11] gdiplus: Support decoders with multiple signatures. --- dlls/gdiplus/image.c | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 58f3c65..f60f75c 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -2517,10 +2517,11 @@ static const struct image_codec codecs[NUM_CODECS]; static GpStatus get_decoder_info(IStream* stream, const struct image_codec **result) { BYTE signature[8]; + const BYTE *pattern, *mask; LARGE_INTEGER seek; HRESULT hr; UINT bytesread; - int i, j; + int i, j, sig; /* seek to the start of the stream */ seek.QuadPart = 0; @@ -2528,7 +2529,7 @@ static GpStatus get_decoder_info(IStream* stream, const struct image_codec **res if (FAILED(hr)) return hresult_to_status(hr); /* read the first 8 bytes */ - /* FIXME: This assumes all codecs have one signature <= 8 bytes in length */ + /* FIXME: This assumes all codecs have signatures <= 8 bytes in length */ hr = IStream_Read(stream, signature, 8, &bytesread); if (FAILED(hr)) return hresult_to_status(hr); if (hr == S_FALSE || bytesread == 0) return GenericError; @@ -2537,13 +2538,18 @@ static GpStatus get_decoder_info(IStream* stream, const struct image_codec **res if ((codecs[i].info.Flags & ImageCodecFlagsDecoder) && bytesread >= codecs[i].info.SigSize) { - for (j=0; j