Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
145bda5a
Commit
145bda5a
authored
Oct 19, 2010
by
Krzysztof Nowicki
Committed by
Alexandre Julliard
Oct 20, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Fix *_CopyPixels functions to properly handle a NULL rectangle.
parent
f8e4a0f3
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
0 deletions
+81
-0
converter.c
dlls/windowscodecs/converter.c
+16
-0
fliprotate.c
dlls/windowscodecs/fliprotate.c
+13
-0
gifformat.c
dlls/windowscodecs/gifformat.c
+12
-0
jpegformat.c
dlls/windowscodecs/jpegformat.c
+16
-0
main.c
dlls/windowscodecs/main.c
+12
-0
tiffformat.c
dlls/windowscodecs/tiffformat.c
+12
-0
No files found.
dlls/windowscodecs/converter.c
View file @
145bda5a
...
...
@@ -850,11 +850,27 @@ static HRESULT WINAPI FormatConverter_CopyPixels(IWICFormatConverter *iface,
const
WICRect
*
prc
,
UINT
cbStride
,
UINT
cbBufferSize
,
BYTE
*
pbBuffer
)
{
FormatConverter
*
This
=
(
FormatConverter
*
)
iface
;
WICRect
rc
;
HRESULT
hr
;
TRACE
(
"(%p,%p,%u,%u,%p)
\n
"
,
iface
,
prc
,
cbStride
,
cbBufferSize
,
pbBuffer
);
if
(
This
->
source
)
{
if
(
!
prc
)
{
UINT
width
,
height
;
hr
=
IWICBitmapSource_GetSize
(
This
->
source
,
&
width
,
&
height
);
if
(
FAILED
(
hr
))
return
hr
;
rc
.
X
=
0
;
rc
.
Y
=
0
;
rc
.
Width
=
width
;
rc
.
Height
=
height
;
prc
=
&
rc
;
}
return
This
->
dst_format
->
copy_function
(
This
,
prc
,
cbStride
,
cbBufferSize
,
pbBuffer
,
This
->
src_format
->
format
);
}
else
return
WINCODEC_ERR_NOTINITIALIZED
;
}
...
...
dlls/windowscodecs/fliprotate.c
View file @
145bda5a
...
...
@@ -140,6 +140,7 @@ static HRESULT WINAPI FlipRotator_CopyPixels(IWICBitmapFlipRotator *iface,
UINT
y
;
UINT
srcy
,
srcwidth
,
srcheight
;
WICRect
rc
;
WICRect
rect
;
TRACE
(
"(%p,%p,%u,%u,%p)
\n
"
,
iface
,
prc
,
cbStride
,
cbBufferSize
,
pbBuffer
);
...
...
@@ -155,6 +156,18 @@ static HRESULT WINAPI FlipRotator_CopyPixels(IWICBitmapFlipRotator *iface,
hr
=
IWICBitmapSource_GetSize
(
This
->
source
,
&
srcwidth
,
&
srcheight
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
!
prc
)
{
UINT
width
,
height
;
hr
=
IWICBitmapSource_GetSize
(
iface
,
&
width
,
&
height
);
if
(
FAILED
(
hr
))
return
hr
;
rect
.
X
=
0
;
rect
.
Y
=
0
;
rect
.
Width
=
width
;
rect
.
Height
=
height
;
prc
=
&
rect
;
}
for
(
y
=
prc
->
Y
;
y
-
prc
->
Y
<
prc
->
Height
;
y
++
)
{
if
(
This
->
flip_y
)
...
...
dlls/windowscodecs/gifformat.c
View file @
145bda5a
...
...
@@ -184,9 +184,21 @@ static HRESULT copy_interlaced_pixels(const BYTE *srcbuffer,
const
BYTE
*
src
;
BYTE
*
dst
;
UINT
y
;
WICRect
rect
;
if
(
!
rc
)
{
rect
.
X
=
0
;
rect
.
Y
=
0
;
rect
.
Width
=
srcwidth
;
rect
.
Height
=
srcheight
;
rc
=
&
rect
;
}
else
{
if
(
rc
->
X
<
0
||
rc
->
Y
<
0
||
rc
->
X
+
rc
->
Width
>
srcwidth
||
rc
->
Y
+
rc
->
Height
>
srcheight
)
return
E_INVALIDARG
;
}
if
(
dststride
<
rc
->
Width
)
return
E_INVALIDARG
;
...
...
dlls/windowscodecs/jpegformat.c
View file @
145bda5a
...
...
@@ -519,8 +519,24 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface,
UINT
data_size
;
UINT
max_row_needed
;
jmp_buf
jmpbuf
;
WICRect
rect
;
TRACE
(
"(%p,%p,%u,%u,%p)
\n
"
,
iface
,
prc
,
cbStride
,
cbBufferSize
,
pbBuffer
);
if
(
!
prc
)
{
rect
.
X
=
0
;
rect
.
Y
=
0
;
rect
.
Width
=
This
->
cinfo
.
output_width
;
rect
.
Height
=
This
->
cinfo
.
output_height
;
prc
=
&
rect
;
}
else
{
if
(
prc
->
X
<
0
||
prc
->
Y
<
0
||
prc
->
X
+
prc
->
Width
>
This
->
cinfo
.
output_width
||
prc
->
Y
+
prc
->
Height
>
This
->
cinfo
.
output_height
)
return
E_INVALIDARG
;
}
if
(
This
->
cinfo
.
out_color_space
==
JCS_GRAYSCALE
)
bpp
=
8
;
else
if
(
This
->
cinfo
.
out_color_space
==
JCS_CMYK
)
bpp
=
32
;
else
bpp
=
24
;
...
...
dlls/windowscodecs/main.c
View file @
145bda5a
...
...
@@ -53,9 +53,21 @@ HRESULT copy_pixels(UINT bpp, const BYTE *srcbuffer,
{
UINT
bytesperrow
;
UINT
row_offset
;
/* number of bits into the source rows where the data starts */
WICRect
rect
;
if
(
!
rc
)
{
rect
.
X
=
0
;
rect
.
Y
=
0
;
rect
.
Width
=
srcwidth
;
rect
.
Height
=
srcheight
;
rc
=
&
rect
;
}
else
{
if
(
rc
->
X
<
0
||
rc
->
Y
<
0
||
rc
->
X
+
rc
->
Width
>
srcwidth
||
rc
->
Y
+
rc
->
Height
>
srcheight
)
return
E_INVALIDARG
;
}
bytesperrow
=
((
bpp
*
rc
->
Width
)
+
7
)
/
8
;
...
...
dlls/windowscodecs/tiffformat.c
View file @
145bda5a
...
...
@@ -799,12 +799,24 @@ static HRESULT WINAPI TiffFrameDecode_CopyPixels(IWICBitmapFrameDecode *iface,
HRESULT
hr
=
S_OK
;
BYTE
*
dst_tilepos
;
UINT
bytesperrow
;
WICRect
rect
;
TRACE
(
"(%p,%p,%u,%u,%p)
\n
"
,
iface
,
prc
,
cbStride
,
cbBufferSize
,
pbBuffer
);
if
(
!
prc
)
{
rect
.
X
=
0
;
rect
.
Y
=
0
;
rect
.
Width
=
This
->
decode_info
.
width
;
rect
.
Height
=
This
->
decode_info
.
height
;
prc
=
&
rect
;
}
else
{
if
(
prc
->
X
<
0
||
prc
->
Y
<
0
||
prc
->
X
+
prc
->
Width
>
This
->
decode_info
.
width
||
prc
->
Y
+
prc
->
Height
>
This
->
decode_info
.
height
)
return
E_INVALIDARG
;
}
bytesperrow
=
((
This
->
decode_info
.
bpp
*
prc
->
Width
)
+
7
)
/
8
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment