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
09602dbe
Commit
09602dbe
authored
May 06, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wav_seek_tag: fix integer overflow
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
5cb9093a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
wavdec.c
libavformat/wavdec.c
+3
-4
No files found.
libavformat/wavdec.c
View file @
09602dbe
...
@@ -64,7 +64,9 @@ static int64_t next_tag(AVIOContext *pb, uint32_t *tag)
...
@@ -64,7 +64,9 @@ static int64_t next_tag(AVIOContext *pb, uint32_t *tag)
/* RIFF chunks are always on a even offset. */
/* RIFF chunks are always on a even offset. */
static
int64_t
wav_seek_tag
(
AVIOContext
*
s
,
int64_t
offset
,
int
whence
)
static
int64_t
wav_seek_tag
(
AVIOContext
*
s
,
int64_t
offset
,
int
whence
)
{
{
return
avio_seek
(
s
,
offset
+
(
offset
&
1
),
whence
);
offset
+=
offset
<
INT64_MAX
&&
offset
&
1
;
return
avio_seek
(
s
,
offset
,
whence
);
}
}
/* return the size of the found tag */
/* return the size of the found tag */
...
@@ -366,9 +368,6 @@ static int wav_read_header(AVFormatContext *s)
...
@@ -366,9 +368,6 @@ static int wav_read_header(AVFormatContext *s)
break
;
break
;
}
}
/* skip padding byte */
next_tag_ofs
+=
(
next_tag_ofs
<
INT64_MAX
&&
next_tag_ofs
&
1
);
/* seek to next tag unless we know that we'll run into EOF */
/* seek to next tag unless we know that we'll run into EOF */
if
((
avio_size
(
pb
)
>
0
&&
next_tag_ofs
>=
avio_size
(
pb
))
||
if
((
avio_size
(
pb
)
>
0
&&
next_tag_ofs
>=
avio_size
(
pb
))
||
wav_seek_tag
(
pb
,
next_tag_ofs
,
SEEK_SET
)
<
0
)
{
wav_seek_tag
(
pb
,
next_tag_ofs
,
SEEK_SET
)
<
0
)
{
...
...
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