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
1441311d
Commit
1441311d
authored
May 10, 2008
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 12, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Avoid null pointer dereference in CreateDIBSection.
parent
02bf65a7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
dib.c
dlls/gdi32/dib.c
+5
-0
bitmap.c
dlls/gdi32/tests/bitmap.c
+7
-0
No files found.
dlls/gdi32/dib.c
View file @
1441311d
...
...
@@ -1258,6 +1258,11 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage,
DWORD
compression
,
sizeImage
;
void
*
mapBits
=
NULL
;
if
(
!
bmi
){
if
(
bits
)
*
bits
=
NULL
;
return
NULL
;
}
if
(((
bitmap_type
=
DIB_GetBitmapInfo
(
&
bmi
->
bmiHeader
,
&
width
,
&
height
,
&
planes
,
&
bpp
,
&
compression
,
&
sizeImage
))
==
-
1
))
return
0
;
...
...
dlls/gdi32/tests/bitmap.c
View file @
1441311d
...
...
@@ -416,6 +416,13 @@ static void test_dibsections(void)
pbmi
->
bmiHeader
.
biCompression
=
BI_RGB
;
SetLastError
(
0xdeadbeef
);
/* invalid pointer for BITMAPINFO
(*bits should be NULL on error) */
bits
=
(
BYTE
*
)
0xdeadbeef
;
hdib
=
CreateDIBSection
(
hdc
,
NULL
,
DIB_RGB_COLORS
,
(
void
**
)
&
bits
,
NULL
,
0
);
ok
(
hdib
==
NULL
&&
bits
==
NULL
,
"CreateDIBSection failed for invalid parameter: bmi == 0x0
\n
"
);
hdib
=
CreateDIBSection
(
hdc
,
pbmi
,
DIB_RGB_COLORS
,
(
void
**
)
&
bits
,
NULL
,
0
);
ok
(
hdib
!=
NULL
,
"CreateDIBSection error %d
\n
"
,
GetLastError
());
ok
(
GetObject
(
hdib
,
sizeof
(
DIBSECTION
),
&
dibsec
)
!=
0
,
"GetObject failed for DIBSection
\n
"
);
...
...
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