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
3d0f272a
Commit
3d0f272a
authored
Aug 04, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Create a sanitized BITMAPINFOHEADER in CreateDIBitmap.
parent
a2c99c73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
17 deletions
+9
-17
dib.c
dlls/gdi32/dib.c
+9
-17
No files found.
dlls/gdi32/dib.c
View file @
3d0f272a
...
...
@@ -1159,32 +1159,24 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header,
DWORD
init
,
LPCVOID
bits
,
const
BITMAPINFO
*
data
,
UINT
coloruse
)
{
BITMAPINFOHEADER
info
;
HBITMAP
handle
;
LONG
width
;
LONG
height
;
WORD
planes
,
bpp
;
DWORD
compr
,
size
;
if
(
!
header
)
return
0
;
if
(
!
bitmapinfoheader_from_user_bitmapinfo
(
&
info
,
header
))
return
0
;
if
(
info
.
biWidth
<
0
)
return
0
;
if
(
DIB_GetBitmapInfo
(
header
,
&
width
,
&
height
,
&
planes
,
&
bpp
,
&
compr
,
&
size
)
==
-
1
)
return
0
;
if
(
width
<
0
)
{
TRACE
(
"Bitmap has a negative width
\n
"
);
return
0
;
}
/* Top-down DIBs have a negative height */
if
(
height
<
0
)
height
=
-
height
;
height
=
abs
(
info
.
biHeight
)
;
TRACE
(
"hdc=%p, header=%p, init=%u, bits=%p, data=%p, coloruse=%u (bitmap: width=%d, height=%d, bpp=%u, compr=%u)
\n
"
,
hdc
,
header
,
init
,
bits
,
data
,
coloruse
,
width
,
height
,
bpp
,
compr
);
hdc
,
header
,
init
,
bits
,
data
,
coloruse
,
info
.
biWidth
,
info
.
biHeight
,
info
.
biBitCount
,
info
.
biCompression
);
if
(
hdc
==
NULL
)
handle
=
CreateBitmap
(
w
idth
,
height
,
1
,
1
,
NULL
);
handle
=
CreateBitmap
(
info
.
biW
idth
,
height
,
1
,
1
,
NULL
);
else
handle
=
CreateCompatibleBitmap
(
hdc
,
w
idth
,
height
);
handle
=
CreateCompatibleBitmap
(
hdc
,
info
.
biW
idth
,
height
);
if
(
handle
)
{
...
...
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