[WINDOWSCODECS] Sync with Wine Staging 4.0. CORE-15682
[reactos.git] / dll / win32 / windowscodecs / main.c
index 6f781b8..7828151 100644 (file)
@@ -82,7 +82,7 @@ HRESULT copy_pixels(UINT bpp, const BYTE *srcbuffer,
     if (dststride < bytesperrow)
         return E_INVALIDARG;
 
-    if ((dststride * (rc->Height-1)) + ((rc->Width * bpp) + 7)/8 > dstbuffersize)
+    if ((dststride * (rc->Height-1)) + bytesperrow > dstbuffersize)
         return E_INVALIDARG;
 
     /* if the whole bitmap is copied and the buffer format matches then it's a matter of a single memcpy */
@@ -182,7 +182,7 @@ HRESULT write_source(IWICBitmapFrameEncode *iface,
     if (FAILED(hr))
     {
         ERR("Failed to convert source, target format %s, %#x\n", debugstr_guid(format), hr);
-        return hr;
+        return E_NOTIMPL;
     }
 
     stride = (bpp * width + 7)/8;