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
a2c99c73
Commit
a2c99c73
authored
Aug 04, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Create a sanitized BITMAPINFOHEADER in GetDIBits.
parent
f234ce9d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
22 deletions
+10
-22
dib.c
dlls/gdi32/dib.c
+10
-22
No files found.
dlls/gdi32/dib.c
View file @
a2c99c73
...
...
@@ -918,24 +918,24 @@ INT WINAPI GetDIBits(
DC
*
dc
;
BITMAPOBJ
*
bmp
;
int
i
;
int
bitmap_type
;
LONG
width
;
LONG
height
;
WORD
planes
,
bpp
;
DWORD
compr
,
size
;
WORD
bpp
;
char
dst_bmibuf
[
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
]
)];
BITMAPINFO
*
dst_info
=
(
BITMAPINFO
*
)
dst_bmibuf
;
unsigned
int
colors
=
0
;
const
struct
gdi_dc_funcs
*
funcs
;
if
(
!
info
)
return
0
;
bitmap_type
=
DIB_GetBitmapInfo
(
&
info
->
bmiHeader
,
&
width
,
&
height
,
&
planes
,
&
bpp
,
&
compr
,
&
size
);
if
(
bitmap_type
==
-
1
)
/* Since info may be a BITMAPCOREINFO or any of the larger BITMAPINFO structures, we'll use our
own copy and transfer the colour info back at the end */
if
(
!
bitmapinfoheader_from_user_bitmapinfo
(
&
dst_info
->
bmiHeader
,
&
info
->
bmiHeader
))
{
ERR
(
"Invalid bitmap format
\n
"
);
return
0
;
}
dst_info
->
bmiHeader
.
biClrUsed
=
0
;
dst_info
->
bmiHeader
.
biClrImportant
=
0
;
if
(
!
(
dc
=
get_dc_ptr
(
hdc
)))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
...
...
@@ -951,27 +951,15 @@ INT WINAPI GetDIBits(
funcs
=
bmp
->
funcs
;
if
(
bmp
->
dib
)
funcs
=
dc
->
dibdrv
.
dev
.
funcs
;
width
=
dst_info
->
bmiHeader
.
biWidth
;
height
=
dst_info
->
bmiHeader
.
biHeight
;
bpp
=
dst_info
->
bmiHeader
.
biBitCount
;
if
(
bpp
==
0
)
/* query bitmap info only */
{
lines
=
fill_query_info
(
info
,
bmp
);
goto
done
;
}
/* Since info may be a BITMAPCOREINFO or any of the larger BITMAPINFO structures, we'll use our
own copy and transfer the colour info back at the end */
dst_info
->
bmiHeader
.
biSize
=
sizeof
(
dst_info
->
bmiHeader
);
dst_info
->
bmiHeader
.
biWidth
=
width
;
dst_info
->
bmiHeader
.
biHeight
=
height
;
dst_info
->
bmiHeader
.
biPlanes
=
planes
;
dst_info
->
bmiHeader
.
biBitCount
=
bpp
;
dst_info
->
bmiHeader
.
biCompression
=
compr
;
dst_info
->
bmiHeader
.
biSizeImage
=
get_dib_image_size
(
dst_info
);
dst_info
->
bmiHeader
.
biXPelsPerMeter
=
0
;
dst_info
->
bmiHeader
.
biYPelsPerMeter
=
0
;
dst_info
->
bmiHeader
.
biClrUsed
=
0
;
dst_info
->
bmiHeader
.
biClrImportant
=
0
;
switch
(
bpp
)
{
case
1
:
...
...
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