diff --git a/dlls/windowscodecs/scaler.c b/dlls/windowscodecs/scaler.c index c6c758d320e..201cf5fc7ac 100644 --- a/dlls/windowscodecs/scaler.c +++ b/dlls/windowscodecs/scaler.c @@ -225,7 +225,7 @@ static HRESULT WINAPI BitmapScaler_CopyPixels(IWICBitmapScaler *iface, if (!This->source) { - hr = WINCODEC_ERR_WRONGSTATE; + hr = WINCODEC_ERR_NOTINITIALIZED; goto end; } diff --git a/dlls/windowscodecs/tests/bitmap.c b/dlls/windowscodecs/tests/bitmap.c index 748082032d2..278c8a8f8d6 100644 --- a/dlls/windowscodecs/tests/bitmap.c +++ b/dlls/windowscodecs/tests/bitmap.c @@ -1163,6 +1163,7 @@ static void test_bitmap_scaler(void) double res_x, res_y; IWICBitmap *bitmap; UINT width, height; + BYTE buf[16]; HRESULT hr; hr = IWICImagingFactory_CreateBitmap(factory, 4, 2, &GUID_WICPixelFormat24bppBGR, WICBitmapCacheOnLoad, &bitmap); @@ -1240,6 +1241,9 @@ static void test_bitmap_scaler(void) hr = IWICBitmapScaler_GetSize(scaler, &width, &height); ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#x.\n", hr); + hr = IWICBitmapScaler_CopyPixels(scaler, NULL, 1, sizeof(buf), buf); + ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#x.\n", hr); + hr = IWICBitmapScaler_Initialize(scaler, (IWICBitmapSource *)bitmap, 0, 2, WICBitmapInterpolationModeNearestNeighbor); ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);