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
f4ef7ff4
Commit
f4ef7ff4
authored
Jan 10, 2011
by
Vincent Povirk
Committed by
Alexandre Julliard
Jan 11, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Accept failure when seeking to the start of a TGA footer.
parent
377d8908
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
12 deletions
+19
-12
tgaformat.c
dlls/windowscodecs/tgaformat.c
+19
-12
No files found.
dlls/windowscodecs/tgaformat.c
View file @
f4ef7ff4
...
...
@@ -284,25 +284,32 @@ static HRESULT WINAPI TgaDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p
/* Read footer if there is one */
seek
.
QuadPart
=
-
sizeof
(
tga_footer
);
hr
=
IStream_Seek
(
pIStream
,
seek
,
STREAM_SEEK_END
,
NULL
);
if
(
FAILED
(
hr
))
goto
end
;
hr
=
IStream_Read
(
pIStream
,
&
footer
,
sizeof
(
tga_footer
),
&
bytesread
);
if
(
SUCCEEDED
(
hr
)
&&
bytesread
!=
sizeof
(
tga_footer
))
{
TRACE
(
"got only %u footer bytes
\n
"
,
bytesread
);
hr
=
E_FAIL
;
}
if
(
FAILED
(
hr
))
goto
end
;
if
(
SUCCEEDED
(
hr
))
{
hr
=
IStream_Read
(
pIStream
,
&
footer
,
sizeof
(
tga_footer
),
&
bytesread
);
if
(
SUCCEEDED
(
hr
)
&&
bytesread
!=
sizeof
(
tga_footer
))
{
TRACE
(
"got only %u footer bytes
\n
"
,
bytesread
)
;
hr
=
E_FAIL
;
}
if
(
memcmp
(
footer
.
magic
,
tga_footer_magic
,
sizeof
(
tga_footer_magic
))
==
0
)
{
This
->
extension_area_offset
=
footer
.
extension_area_offset
;
This
->
developer_directory_offset
=
footer
.
developer_directory_offset
;
if
(
memcmp
(
footer
.
magic
,
tga_footer_magic
,
sizeof
(
tga_footer_magic
))
==
0
)
{
This
->
extension_area_offset
=
footer
.
extension_area_offset
;
This
->
developer_directory_offset
=
footer
.
developer_directory_offset
;
}
else
{
This
->
extension_area_offset
=
0
;
This
->
developer_directory_offset
=
0
;
}
}
else
{
/* File is too small to have a footer. */
This
->
extension_area_offset
=
0
;
This
->
developer_directory_offset
=
0
;
hr
=
S_OK
;
}
if
(
This
->
extension_area_offset
)
...
...
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