Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
a9553e8f
Commit
a9553e8f
authored
Aug 09, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/tiff: avoid seek back on reading tags
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
c94f9e85
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
tiff.c
libavcodec/tiff.c
+6
-7
No files found.
libavcodec/tiff.c
View file @
a9553e8f
...
...
@@ -705,8 +705,7 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
tag
=
tget_short
(
&
s
->
gb
,
s
->
le
);
type
=
tget_short
(
&
s
->
gb
,
s
->
le
);
count
=
tget_long
(
&
s
->
gb
,
s
->
le
);
off
=
tget_long
(
&
s
->
gb
,
s
->
le
);
start
=
bytestream2_tell
(
&
s
->
gb
);
start
=
bytestream2_tell
(
&
s
->
gb
)
+
4
;
if
(
type
==
0
||
type
>=
FF_ARRAY_ELEMS
(
type_sizes
))
{
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
"Unknown tiff type (%u) encountered
\n
"
,
...
...
@@ -718,26 +717,26 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
switch
(
type
)
{
case
TIFF_BYTE
:
case
TIFF_SHORT
:
bytestream2_seek
(
&
s
->
gb
,
-
4
,
SEEK_CUR
);
value
=
tget
(
&
s
->
gb
,
type
,
s
->
le
);
break
;
case
TIFF_LONG
:
off
=
tget_long
(
&
s
->
gb
,
s
->
le
);
value
=
off
;
break
;
case
TIFF_STRING
:
if
(
count
<=
4
)
{
bytestream2_seek
(
&
s
->
gb
,
-
4
,
SEEK_CUR
);
break
;
}
default:
off
=
tget_long
(
&
s
->
gb
,
s
->
le
);
value
=
UINT_MAX
;
bytestream2_seek
(
&
s
->
gb
,
off
,
SEEK_SET
);
}
}
else
{
if
(
count
<=
4
&&
type_sizes
[
type
]
*
count
<=
4
)
bytestream2_seek
(
&
s
->
gb
,
-
4
,
SEEK_CUR
);
else
if
(
count
>
4
||
type_sizes
[
type
]
*
count
>
4
)
{
off
=
tget_long
(
&
s
->
gb
,
s
->
le
);
bytestream2_seek
(
&
s
->
gb
,
off
,
SEEK_SET
);
}
}
switch
(
tag
)
{
...
...
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