Module: wine Branch: master Commit: d90047ed91f783dea5395f54a8f4dc04f35b632a URL: https://source.winehq.org/git/wine.git/?a=commit;h=d90047ed91f783dea5395f54a...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Fri Nov 30 09:53:31 2018 +0300
windowscodecs: PNG decoder should return WINCODEC_ERR_UNKNOWNIMAGEFORMAT when image loading fails.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/windowscodecs/pngformat.c | 2 +- dlls/windowscodecs/tests/pngformat.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c index fc1f756..c0e5a59 100644 --- a/dlls/windowscodecs/pngformat.c +++ b/dlls/windowscodecs/pngformat.c @@ -622,7 +622,7 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p ppng_destroy_read_struct(&This->png_ptr, &This->info_ptr, &This->end_info); HeapFree(GetProcessHeap(), 0, row_pointers); This->png_ptr = NULL; - hr = E_FAIL; + hr = WINCODEC_ERR_UNKNOWNIMAGEFORMAT; goto end; } ppng_set_error_fn(This->png_ptr, jmpbuf, user_error_fn, user_warning_fn); diff --git a/dlls/windowscodecs/tests/pngformat.c b/dlls/windowscodecs/tests/pngformat.c index 5f4a5e1..d08a5fb 100644 --- a/dlls/windowscodecs/tests/pngformat.c +++ b/dlls/windowscodecs/tests/pngformat.c @@ -811,7 +811,6 @@ static void test_color_formats(void)
hr = create_decoder(buf, sizeof(buf), &decoder); if (!is_valid_png_type_depth(td[i].color_type, td[i].bit_depth, TRUE)) -todo_wine ok(hr == WINCODEC_ERR_UNKNOWNIMAGEFORMAT, "%d: wrong error %#x\n", i, hr); else todo_wine_if(td[i].todo_load) @@ -840,7 +839,6 @@ next_1:
hr = create_decoder(buf, sizeof(buf), &decoder); if (!is_valid_png_type_depth(td[i].color_type, td[i].bit_depth, TRUE)) -todo_wine ok(hr == WINCODEC_ERR_UNKNOWNIMAGEFORMAT, "%d: wrong error %#x\n", i, hr); else todo_wine_if(td[i].todo_load) @@ -869,7 +867,6 @@ next_2:
hr = create_decoder(buf, sizeof(buf), &decoder); if (!is_valid_png_type_depth(td[i].color_type, td[i].bit_depth, FALSE)) -todo_wine ok(hr == WINCODEC_ERR_UNKNOWNIMAGEFORMAT, "%d: wrong error %#x\n", i, hr); else todo_wine_if(td[i].todo_load) @@ -897,7 +894,6 @@ next_3:
hr = create_decoder(buf, sizeof(buf), &decoder); if (!is_valid_png_type_depth(td[i].color_type, td[i].bit_depth, FALSE)) -todo_wine ok(hr == WINCODEC_ERR_UNKNOWNIMAGEFORMAT, "%d: wrong error %#x\n", i, hr); else todo_wine_if(td[i].todo_load)