From a8eaeaf511d6deb1fe025b5893fdfbcb0734e095 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Fri, 23 Nov 2012 15:41:33 +0800 Subject: [PATCH] windowscodecs: Make GetFrame return WINCODEC_ERR_FRAMEMISSING without an image data. --- dlls/windowscodecs/bmpdecode.c | 2 +- dlls/windowscodecs/gifformat.c | 2 +- dlls/windowscodecs/icoformat.c | 2 +- dlls/windowscodecs/jpegformat.c | 2 +- dlls/windowscodecs/pngformat.c | 2 +- dlls/windowscodecs/tgaformat.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/windowscodecs/bmpdecode.c b/dlls/windowscodecs/bmpdecode.c index 1a1ee0aa3d4..7b3f82dac56 100644 --- a/dlls/windowscodecs/bmpdecode.c +++ b/dlls/windowscodecs/bmpdecode.c @@ -1124,7 +1124,7 @@ static HRESULT WINAPI BmpDecoder_GetFrame(IWICBitmapDecoder *iface, if (index != 0) return E_INVALIDARG; - if (!This->stream) return WINCODEC_ERR_WRONGSTATE; + if (!This->stream) return WINCODEC_ERR_FRAMEMISSING; *ppIBitmapFrame = &This->IWICBitmapFrameDecode_iface; IWICBitmapDecoder_AddRef(iface); diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c index d87a6e76f96..ce63af9a494 100644 --- a/dlls/windowscodecs/gifformat.c +++ b/dlls/windowscodecs/gifformat.c @@ -1271,7 +1271,7 @@ static HRESULT WINAPI GifDecoder_GetFrame(IWICBitmapDecoder *iface, GifFrameDecode *result; TRACE("(%p,%u,%p)\n", iface, index, ppIBitmapFrame); - if (!This->initialized) return WINCODEC_ERR_NOTINITIALIZED; + if (!This->initialized) return WINCODEC_ERR_FRAMEMISSING; if (index >= This->gif->ImageCount) return E_INVALIDARG; diff --git a/dlls/windowscodecs/icoformat.c b/dlls/windowscodecs/icoformat.c index 4e83ec02590..6b454c29a2c 100644 --- a/dlls/windowscodecs/icoformat.c +++ b/dlls/windowscodecs/icoformat.c @@ -631,7 +631,7 @@ static HRESULT WINAPI IcoDecoder_GetFrame(IWICBitmapDecoder *iface, if (!This->initialized) { - hr = WINCODEC_ERR_NOTINITIALIZED; + hr = WINCODEC_ERR_FRAMEMISSING; goto fail; } diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c index 2c77d4f4c0a..eab50f02cd1 100644 --- a/dlls/windowscodecs/jpegformat.c +++ b/dlls/windowscodecs/jpegformat.c @@ -440,7 +440,7 @@ static HRESULT WINAPI JpegDecoder_GetFrame(IWICBitmapDecoder *iface, JpegDecoder *This = impl_from_IWICBitmapDecoder(iface); TRACE("(%p,%u,%p)\n", iface, index, ppIBitmapFrame); - if (!This->initialized) return WINCODEC_ERR_NOTINITIALIZED; + if (!This->initialized) return WINCODEC_ERR_FRAMEMISSING; if (index != 0) return E_INVALIDARG; diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c index 6d6117e99a6..4c94489fe8e 100644 --- a/dlls/windowscodecs/pngformat.c +++ b/dlls/windowscodecs/pngformat.c @@ -650,7 +650,7 @@ static HRESULT WINAPI PngDecoder_GetFrame(IWICBitmapDecoder *iface, PngDecoder *This = impl_from_IWICBitmapDecoder(iface); TRACE("(%p,%u,%p)\n", iface, index, ppIBitmapFrame); - if (!This->initialized) return WINCODEC_ERR_NOTINITIALIZED; + if (!This->initialized) return WINCODEC_ERR_FRAMEMISSING; if (index != 0) return E_INVALIDARG; diff --git a/dlls/windowscodecs/tgaformat.c b/dlls/windowscodecs/tgaformat.c index eac340690a8..cd615c71c80 100644 --- a/dlls/windowscodecs/tgaformat.c +++ b/dlls/windowscodecs/tgaformat.c @@ -415,7 +415,7 @@ static HRESULT WINAPI TgaDecoder_GetFrame(IWICBitmapDecoder *iface, TgaDecoder *This = impl_from_IWICBitmapDecoder(iface); TRACE("(%p,%p)\n", iface, ppIBitmapFrame); - if (!This->initialized) return WINCODEC_ERR_NOTINITIALIZED; + if (!This->initialized) return WINCODEC_ERR_FRAMEMISSING; if (index != 0) return E_INVALIDARG;