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
e9b0ea15
Commit
e9b0ea15
authored
Aug 18, 2004
by
Alex Villacís Lasso
Committed by
Alexandre Julliard
Aug 18, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add detection of graphic file header in picture load, treat it as
no-header case.
parent
dfe3c1c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
olepicture.c
dlls/oleaut32/olepicture.c
+11
-1
No files found.
dlls/oleaut32/olepicture.c
View file @
e9b0ea15
...
...
@@ -956,6 +956,13 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface,IStream*pStm) {
/* Sometimes we have a header, sometimes we don't. Apply some guesses to find
* out whether we do.
*
* UPDATE: the IStream can be mapped to a plain file instead of a stream in a
* compound file. This may explain most, if not all, of the cases of "no header",
* and the header validation should take this into account. At least in Visual Basic 6,
* resource streams, valid headers are
* header[0] == "lt\0\0",
* header[1] == length_of_stream.
*/
hr
=
IStream_Stat
(
pStm
,
&
statstg
,
STATFLAG_NONAME
);
if
(
hr
)
...
...
@@ -965,7 +972,10 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface,IStream*pStm) {
FIXME
(
"Failure while reading picture header (hr is %lx, nread is %ld).
\n
"
,
hr
,
xread
);
return
hr
;
}
if
(
header
[
1
]
>
statstg
.
cbSize
.
QuadPart
||
(
header
[
1
]
==
0
))
{
/* Incorrect header, assume none. */
if
(
!
memcmp
(
&
(
header
[
0
]),
"GIF8"
,
4
)
||
/* GIF header */
!
memcmp
(
&
(
header
[
0
]),
"BM"
,
2
)
||
/* BMP header */
!
memcmp
(
&
(
header
[
0
]),
"
\xff\xd8
"
,
2
)
||
/* JPEG header */
header
[
1
]
>
statstg
.
cbSize
.
QuadPart
||
(
header
[
1
]
==
0
))
{
/* Incorrect header, assume none. */
xread
=
8
;
xbuf
=
This
->
data
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
statstg
.
cbSize
.
QuadPart
);
memcpy
(
xbuf
,
&
header
,
8
);
...
...
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