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
82e1a461
Commit
82e1a461
authored
Dec 10, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Make sure that biSizeImage always contains the correct size in internal…
gdi32: Make sure that biSizeImage always contains the correct size in internal BITMAPINFO structures.
parent
25e2fae2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
bitblt.c
dlls/gdi32/bitblt.c
+9
-5
brush.c
dlls/gdi32/brush.c
+2
-2
No files found.
dlls/gdi32/bitblt.c
View file @
82e1a461
...
...
@@ -170,7 +170,9 @@ DWORD convert_bits( const BITMAPINFO *src_info, struct bitblt_coords *src,
DWORD
err
;
dst_info
->
bmiHeader
.
biWidth
=
src
->
visrect
.
right
-
src
->
visrect
.
left
;
if
(
!
(
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
get_dib_image_size
(
dst_info
))))
dst_info
->
bmiHeader
.
biSizeImage
=
get_dib_image_size
(
dst_info
);
if
(
!
(
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dst_info
->
bmiHeader
.
biSizeImage
)))
return
ERROR_OUTOFMEMORY
;
err
=
convert_bitmapinfo
(
src_info
,
bits
->
ptr
,
src
,
dst_info
,
ptr
,
add_alpha
);
...
...
@@ -190,8 +192,10 @@ DWORD stretch_bits( const BITMAPINFO *src_info, struct bitblt_coords *src,
dst_info
->
bmiHeader
.
biWidth
=
dst
->
visrect
.
right
-
dst
->
visrect
.
left
;
dst_info
->
bmiHeader
.
biHeight
=
dst
->
visrect
.
bottom
-
dst
->
visrect
.
top
;
dst_info
->
bmiHeader
.
biSizeImage
=
get_dib_image_size
(
dst_info
);
if
(
src_info
->
bmiHeader
.
biHeight
<
0
)
dst_info
->
bmiHeader
.
biHeight
=
-
dst_info
->
bmiHeader
.
biHeight
;
if
(
!
(
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
get_dib_image_size
(
dst_info
)
)))
if
(
!
(
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dst_info
->
bmiHeader
.
biSizeImage
)))
return
ERROR_OUTOFMEMORY
;
err
=
stretch_bitmapinfo
(
src_info
,
bits
->
ptr
,
src
,
dst_info
,
ptr
,
dst
,
mode
);
...
...
@@ -208,7 +212,7 @@ static DWORD blend_bits( const BITMAPINFO *src_info, const struct gdi_image_bits
{
if
(
!
dst_bits
->
is_copy
)
{
int
size
=
get_dib_image_size
(
dst_info
)
;
int
size
=
dst_info
->
bmiHeader
.
biSizeImage
;
void
*
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
!
ptr
)
return
ERROR_OUTOFMEMORY
;
memcpy
(
ptr
,
dst_bits
->
ptr
,
size
);
...
...
@@ -446,11 +450,11 @@ BOOL nulldrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
info
->
bmiHeader
.
biClrImportant
=
0
;
info
->
bmiHeader
.
biWidth
=
dst
.
visrect
.
right
-
dst
.
visrect
.
left
;
info
->
bmiHeader
.
biHeight
=
dst
.
visrect
.
bottom
-
dst
.
visrect
.
top
;
info
->
bmiHeader
.
biSizeImage
=
0
;
info
->
bmiHeader
.
biSizeImage
=
get_dib_image_size
(
info
)
;
dev
=
GET_DC_PHYSDEV
(
dc
,
pPutImage
);
err
=
dev
->
funcs
->
pPutImage
(
dev
,
0
,
0
,
info
,
NULL
,
NULL
,
NULL
,
0
);
if
((
err
&&
err
!=
ERROR_BAD_FORMAT
)
||
!
(
bits
.
ptr
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
get_dib_image_size
(
info
)
)))
!
(
bits
.
ptr
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
info
->
bmiHeader
.
biSizeImage
)))
{
ret
=
FALSE
;
goto
done
;
...
...
dlls/gdi32/brush.c
View file @
82e1a461
...
...
@@ -126,12 +126,12 @@ static BOOL copy_bitmap( BRUSHOBJ *brush, HBITMAP bitmap )
memcpy
(
&
info
->
bmiHeader
+
1
,
bmp
->
dib
->
dsBitfields
,
sizeof
(
bmp
->
dib
->
dsBitfields
)
);
else
if
(
info
->
bmiHeader
.
biClrUsed
)
memcpy
(
&
info
->
bmiHeader
+
1
,
bmp
->
color_table
,
info
->
bmiHeader
.
biClrUsed
*
sizeof
(
RGBQUAD
)
);
if
(
!
(
brush
->
bits
.
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
get_dib_image_size
(
info
)
)))
if
(
!
(
brush
->
bits
.
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
info
->
bmiHeader
.
biSizeImage
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
info
);
goto
done
;
}
memcpy
(
brush
->
bits
.
ptr
,
bmp
->
dib
->
dsBm
.
bmBits
,
get_dib_image_size
(
info
)
);
memcpy
(
brush
->
bits
.
ptr
,
bmp
->
dib
->
dsBm
.
bmBits
,
info
->
bmiHeader
.
biSizeImage
);
brush
->
bits
.
is_copy
=
TRUE
;
brush
->
bits
.
free
=
free_heap_bits
;
brush
->
info
=
info
;
...
...
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