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
9f0f17f8
Commit
9f0f17f8
authored
Aug 04, 2010
by
Wolfram Sang
Committed by
Alexandre Julliard
Aug 17, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Check for valid pointer in CreateIconFromResource.
parent
e4bb3ae7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
cursoricon.c
dlls/user32/cursoricon.c
+3
-2
cursoricon.c
dlls/user32/tests/cursoricon.c
+5
-0
No files found.
dlls/user32/cursoricon.c
View file @
9f0f17f8
...
...
@@ -1064,8 +1064,6 @@ static HCURSOR CURSORICON_CreateIconFromANI( const LPBYTE bits, DWORD bits_size,
TRACE
(
"bits %p, bits_size %d
\n
"
,
bits
,
bits_size
);
if
(
!
bits
)
return
0
;
riff_find_chunk
(
ANI_ACON_ID
,
ANI_RIFF_ID
,
&
root_chunk
,
&
ACON_chunk
);
if
(
!
ACON_chunk
.
data
)
{
...
...
@@ -1104,6 +1102,7 @@ static HCURSOR CURSORICON_CreateIconFromANI( const LPBYTE bits, DWORD bits_size,
width
,
height
,
depth
);
frame_bits
=
HeapAlloc
(
GetProcessHeap
(),
0
,
entry
->
dwDIBSize
);
if
(
!
frame_bits
)
return
0
;
memcpy
(
frame_bits
,
icon_data
+
entry
->
dwDIBOffset
,
entry
->
dwDIBSize
);
if
(
!
header
.
width
||
!
header
.
height
)
...
...
@@ -1142,6 +1141,8 @@ HICON WINAPI CreateIconFromResourceEx( LPBYTE bits, UINT cbSize,
bits
,
cbSize
,
dwVersion
,
width
,
height
,
bIcon
?
"icon"
:
"cursor"
,
(
cFlag
&
LR_MONOCHROME
)
?
"mono"
:
""
);
if
(
!
bits
)
return
0
;
if
(
bIcon
)
{
hotspot
.
x
=
width
/
2
;
...
...
dlls/user32/tests/cursoricon.c
View file @
9f0f17f8
...
...
@@ -1005,6 +1005,11 @@ static void test_CreateIconFromResource(void)
error
=
GetLastError
();
ok
(
error
==
0xdeadbeef
,
"Last error: %u
\n
"
,
error
);
/* Rejection of NULL pointer crashes at least on WNT4WSSP6, W2KPROSP4, WXPPROSP3
*
* handle = CreateIconFromResource(NULL, ICON_RES_SIZE, TRUE, 0x00030000);
* ok(handle == NULL, "Invalid pointer accepted (%p)\n", handle);
*/
HeapFree
(
GetProcessHeap
(),
0
,
hotspot
);
}
...
...
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