Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
2f9987fd
Commit
2f9987fd
authored
Sep 29, 2015
by
Bruno Jesus
Committed by
Alexandre Julliard
Oct 02, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Cope with invalid icon data in OLEPictureImpl_LoadIcon.
Signed-off-by:
Bruno Jesus
<
00cpxxx@gmail.com
>
parent
dfa73ca6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
olepicture.c
dlls/oleaut32/olepicture.c
+15
-0
No files found.
dlls/oleaut32/olepicture.c
View file @
2f9987fd
...
...
@@ -1210,6 +1210,8 @@ static HRESULT OLEPictureImpl_LoadIcon(OLEPictureImpl *This, BYTE *xbuf, ULONG x
HDC
hdcRef
;
int
i
;
TRACE
(
"(this %p, xbuf %p, xread %u)
\n
"
,
This
,
xbuf
,
xread
);
/*
FIXME("icon.idReserved=%d\n",cifd->idReserved);
FIXME("icon.idType=%d\n",cifd->idType);
...
...
@@ -1226,6 +1228,13 @@ static HRESULT OLEPictureImpl_LoadIcon(OLEPictureImpl *This, BYTE *xbuf, ULONG x
FIXME("[%d] dwDIBOffset %d\n",i,cifd->idEntries[i].dwDIBOffset);
}
*/
/* Need at least one icon to do something. */
if
(
!
cifd
->
idCount
)
{
ERR
(
"Invalid icon count of zero.
\n
"
);
return
E_FAIL
;
}
i
=
0
;
/* If we have more than one icon, try to find the best.
* this currently means '32 pixel wide'.
...
...
@@ -1237,6 +1246,12 @@ static HRESULT OLEPictureImpl_LoadIcon(OLEPictureImpl *This, BYTE *xbuf, ULONG x
}
if
(
i
==
cifd
->
idCount
)
i
=
0
;
}
if
(
xread
<
cifd
->
idEntries
[
i
].
dwDIBOffset
+
cifd
->
idEntries
[
i
].
dwDIBSize
)
{
ERR
(
"Icon data address %u is over %u bytes available.
\n
"
,
cifd
->
idEntries
[
i
].
dwDIBOffset
+
cifd
->
idEntries
[
i
].
dwDIBSize
,
xread
);
return
E_FAIL
;
}
if
(
cifd
->
idType
==
2
)
{
LPBYTE
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cifd
->
idEntries
[
i
].
dwDIBSize
+
4
);
...
...
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