You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Rebase againsts 9ae8b8c00f2cca205fdf4ce76e221778b7dfbea7
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
From 271b0a51b2f1d70fcd7091e4829c77aacfdc0ba1 Mon Sep 17 00:00:00 2001
|
||||
From 77ec3e3c1f2346c5b70647ed2e99102a41bad353 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Fri, 18 Aug 2017 12:03:50 +0800
|
||||
Subject: windowscodecs: Fix stride calculation in JPEG decoder.
|
||||
Subject: [PATCH] windowscodecs: Fix stride calculation in JPEG decoder.
|
||||
|
||||
---
|
||||
dlls/windowscodecs/jpegformat.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c
|
||||
index abab36ab40a..f31239b8d79 100644
|
||||
index 08f1ee7..27cd880 100644
|
||||
--- a/dlls/windowscodecs/jpegformat.c
|
||||
+++ b/dlls/windowscodecs/jpegformat.c
|
||||
@@ -628,7 +628,7 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface,
|
||||
@@ -624,7 +624,7 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface,
|
||||
else if (This->cinfo.out_color_space == JCS_CMYK) bpp = 32;
|
||||
else bpp = 24;
|
||||
|
||||
@@ -21,5 +21,5 @@ index abab36ab40a..f31239b8d79 100644
|
||||
|
||||
max_row_needed = prc->Y + prc->Height;
|
||||
--
|
||||
2.14.1
|
||||
1.9.1
|
||||
|
||||
|
@@ -1,19 +1,19 @@
|
||||
From 799ae0c6a39c58423281ea5d8c46b1085a07bf48 Mon Sep 17 00:00:00 2001
|
||||
From 549a63c40b7b9a73055ece62c2d6c4631de79471 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Fri, 18 Aug 2017 12:12:16 +0800
|
||||
Subject: windowscodecs: Move additional processing out of the JPEG decoding
|
||||
loop.
|
||||
Subject: [PATCH] windowscodecs: Move additional processing out of the JPEG
|
||||
decoding loop.
|
||||
|
||||
This avoids image corruption when libjpeg reuses existing pixel data.
|
||||
---
|
||||
dlls/windowscodecs/jpegformat.c | 27 ++++++++++++++-------------
|
||||
1 file changed, 14 insertions(+), 13 deletions(-)
|
||||
dlls/windowscodecs/jpegformat.c | 38 ++++++++++++++++++++------------------
|
||||
1 file changed, 20 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c
|
||||
index f31239b8d79..0023fd2bf32 100644
|
||||
index 27cd880..97899a7 100644
|
||||
--- a/dlls/windowscodecs/jpegformat.c
|
||||
+++ b/dlls/windowscodecs/jpegformat.c
|
||||
@@ -603,7 +603,7 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface,
|
||||
@@ -599,10 +599,12 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface,
|
||||
JpegDecoder *This = impl_from_IWICBitmapFrameDecode(iface);
|
||||
UINT bpp;
|
||||
UINT stride;
|
||||
@@ -22,15 +22,27 @@ index f31239b8d79..0023fd2bf32 100644
|
||||
UINT max_row_needed;
|
||||
jmp_buf jmpbuf;
|
||||
WICRect rect;
|
||||
@@ -659,7 +659,6 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface,
|
||||
UINT first_scanline = This->cinfo.output_scanline;
|
||||
+ UINT first_scanline = 0;
|
||||
+
|
||||
TRACE("(%p,%p,%u,%u,%p)\n", iface, prc, cbStride, cbBufferSize, pbBuffer);
|
||||
|
||||
if (!prc)
|
||||
@@ -652,12 +654,12 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface,
|
||||
|
||||
while (max_row_needed > This->cinfo.output_scanline)
|
||||
{
|
||||
- UINT first_scanline = This->cinfo.output_scanline;
|
||||
UINT max_rows;
|
||||
JSAMPROW out_rows[4];
|
||||
- UINT i;
|
||||
JDIMENSION ret;
|
||||
|
||||
+ first_scanline = This->cinfo.output_scanline;
|
||||
+
|
||||
max_rows = min(This->cinfo.output_height-first_scanline, 4);
|
||||
@@ -674,19 +673,21 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface,
|
||||
for (i=0; i<max_rows; i++)
|
||||
out_rows[i] = This->image_data + stride * (first_scanline+i);
|
||||
@@ -670,25 +672,25 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface,
|
||||
LeaveCriticalSection(&This->lock);
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -52,17 +64,25 @@ index f31239b8d79..0023fd2bf32 100644
|
||||
+ }
|
||||
|
||||
- if (This->cinfo.out_color_space == JCS_CMYK && This->cinfo.saw_Adobe_marker)
|
||||
- {
|
||||
- DWORD *pDwordData = (DWORD*) (This->image_data + stride * first_scanline);
|
||||
- DWORD *pDwordDataEnd = (DWORD*) (This->image_data + This->cinfo.output_scanline * stride);
|
||||
|
||||
- /* Adobe JPEG's have inverted CMYK data. */
|
||||
- for (i=0; i<data_size; i++)
|
||||
- This->image_data[i] ^= 0xff;
|
||||
- while(pDwordData < pDwordDataEnd)
|
||||
- *pDwordData++ ^= 0xffffffff;
|
||||
- }
|
||||
+ if (This->cinfo.out_color_space == JCS_CMYK && This->cinfo.saw_Adobe_marker)
|
||||
+ {
|
||||
+ DWORD *pDwordData = (DWORD*) (This->image_data + stride * first_scanline);
|
||||
+ DWORD *pDwordDataEnd = (DWORD*) (This->image_data + This->cinfo.output_scanline * stride);
|
||||
|
||||
+ /* Adobe JPEG's have inverted CMYK data. */
|
||||
+ for (i=0; i<data_size; i++)
|
||||
+ This->image_data[i] ^= 0xff;
|
||||
+ while(pDwordData < pDwordDataEnd)
|
||||
+ *pDwordData++ ^= 0xffffffff;
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&This->lock);
|
||||
--
|
||||
2.14.1
|
||||
1.9.1
|
||||
|
||||
|
@@ -1,17 +1,17 @@
|
||||
From 71de59213235b4e41531d0ecff43790cf172bf90 Mon Sep 17 00:00:00 2001
|
||||
From 846b328efd83b161405ed8f663b6cb3465c29ee4 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Fri, 18 Aug 2017 12:17:52 +0800
|
||||
Subject: windowscodecs: Move JPEG frame image data initialization from
|
||||
Subject: [PATCH] windowscodecs: Move JPEG frame image data initialization from
|
||||
Frame::CopyPixels to Decoder::Initialize. (v2)
|
||||
|
||||
This is how PNG decoder does things, and it avoids image data corruption
|
||||
in some cases (presumably when libjpeg reuses existing scanline data).
|
||||
---
|
||||
dlls/windowscodecs/jpegformat.c | 146 +++++++++++++++-------------------------
|
||||
1 file changed, 55 insertions(+), 91 deletions(-)
|
||||
dlls/windowscodecs/jpegformat.c | 151 ++++++++++++++--------------------------
|
||||
1 file changed, 54 insertions(+), 97 deletions(-)
|
||||
|
||||
diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c
|
||||
index 0023fd2bf32..296529cee73 100644
|
||||
index 97899a7..0f02b36 100644
|
||||
--- a/dlls/windowscodecs/jpegformat.c
|
||||
+++ b/dlls/windowscodecs/jpegformat.c
|
||||
@@ -155,6 +155,7 @@ typedef struct {
|
||||
@@ -87,7 +87,7 @@ index 0023fd2bf32..296529cee73 100644
|
||||
This->initialized = TRUE;
|
||||
|
||||
LeaveCriticalSection(&This->lock);
|
||||
@@ -601,99 +653,11 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface,
|
||||
@@ -597,106 +649,11 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface,
|
||||
const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer)
|
||||
{
|
||||
JpegDecoder *This = impl_from_IWICBitmapFrameDecode(iface);
|
||||
@@ -97,8 +97,10 @@ index 0023fd2bf32..296529cee73 100644
|
||||
- UINT max_row_needed;
|
||||
- jmp_buf jmpbuf;
|
||||
- WICRect rect;
|
||||
- TRACE("(%p,%p,%u,%u,%p)\n", iface, prc, cbStride, cbBufferSize, pbBuffer);
|
||||
-
|
||||
- UINT first_scanline = 0;
|
||||
|
||||
TRACE("(%p,%p,%u,%u,%p)\n", iface, prc, cbStride, cbBufferSize, pbBuffer);
|
||||
|
||||
- if (!prc)
|
||||
- {
|
||||
- rect.X = 0;
|
||||
@@ -123,7 +125,7 @@ index 0023fd2bf32..296529cee73 100644
|
||||
-
|
||||
- max_row_needed = prc->Y + prc->Height;
|
||||
- if (max_row_needed > This->cinfo.output_height) return E_INVALIDARG;
|
||||
|
||||
-
|
||||
- EnterCriticalSection(&This->lock);
|
||||
-
|
||||
- if (!This->image_data)
|
||||
@@ -146,11 +148,12 @@ index 0023fd2bf32..296529cee73 100644
|
||||
-
|
||||
- while (max_row_needed > This->cinfo.output_scanline)
|
||||
- {
|
||||
- UINT first_scanline = This->cinfo.output_scanline;
|
||||
- UINT max_rows;
|
||||
- JSAMPROW out_rows[4];
|
||||
- JDIMENSION ret;
|
||||
-
|
||||
- first_scanline = This->cinfo.output_scanline;
|
||||
-
|
||||
- max_rows = min(This->cinfo.output_height-first_scanline, 4);
|
||||
- for (i=0; i<max_rows; i++)
|
||||
- out_rows[i] = This->image_data + stride * (first_scanline+i);
|
||||
@@ -173,16 +176,19 @@ index 0023fd2bf32..296529cee73 100644
|
||||
- stride);
|
||||
- }
|
||||
-
|
||||
-
|
||||
- if (This->cinfo.out_color_space == JCS_CMYK && This->cinfo.saw_Adobe_marker)
|
||||
- {
|
||||
- DWORD *pDwordData = (DWORD*) (This->image_data + stride * first_scanline);
|
||||
- DWORD *pDwordDataEnd = (DWORD*) (This->image_data + This->cinfo.output_scanline * stride);
|
||||
-
|
||||
- /* Adobe JPEG's have inverted CMYK data. */
|
||||
- for (i=0; i<data_size; i++)
|
||||
- This->image_data[i] ^= 0xff;
|
||||
- while(pDwordData < pDwordDataEnd)
|
||||
- *pDwordData++ ^= 0xffffffff;
|
||||
- }
|
||||
-
|
||||
- LeaveCriticalSection(&This->lock);
|
||||
+ TRACE("(%p,%p,%u,%u,%p)\n", iface, prc, cbStride, cbBufferSize, pbBuffer);
|
||||
|
||||
-
|
||||
- return copy_pixels(bpp, This->image_data,
|
||||
- This->cinfo.output_width, This->cinfo.output_height, stride,
|
||||
+ return copy_pixels(This->bpp, This->image_data,
|
||||
@@ -191,5 +197,5 @@ index 0023fd2bf32..296529cee73 100644
|
||||
}
|
||||
|
||||
--
|
||||
2.14.1
|
||||
1.9.1
|
||||
|
||||
|
@@ -1,17 +1,17 @@
|
||||
From 3a05eb9c499b348f3577cc7e7cb8ad23a261e5f0 Mon Sep 17 00:00:00 2001
|
||||
From f26102e49cdff5e0afbb3132b02b9f4fe2d93dd5 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Thu, 17 Aug 2017 14:57:18 +0800
|
||||
Subject: windowscodecs: Add support for CMYK to BGR conversion.
|
||||
Subject: [PATCH] windowscodecs: Add support for CMYK to BGR conversion.
|
||||
|
||||
---
|
||||
dlls/windowscodecs/converter.c | 42 ++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 42 insertions(+)
|
||||
|
||||
diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c
|
||||
index 5dccb70b1fb..525e1838b84 100644
|
||||
index 42ba260..54731ab 100644
|
||||
--- a/dlls/windowscodecs/converter.c
|
||||
+++ b/dlls/windowscodecs/converter.c
|
||||
@@ -1085,6 +1085,48 @@ static HRESULT copypixels_to_24bppBGR(struct FormatConverter *This, const WICRec
|
||||
@@ -1012,6 +1012,48 @@ static HRESULT copypixels_to_24bppBGR(struct FormatConverter *This, const WICRec
|
||||
}
|
||||
return S_OK;
|
||||
|
||||
@@ -61,5 +61,5 @@ index 5dccb70b1fb..525e1838b84 100644
|
||||
FIXME("Unimplemented conversion path!\n");
|
||||
return WINCODEC_ERR_UNSUPPORTEDOPERATION;
|
||||
--
|
||||
2.14.1
|
||||
1.9.1
|
||||
|
||||
|
Reference in New Issue
Block a user