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
a67cb012
Commit
a67cb012
authored
Oct 27, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resample: Fix overflow
Found-by: Jim Radford Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
3e437583
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
resample2.c
libavcodec/resample2.c
+4
-2
resample2.c
libswresample/resample2.c
+4
-2
No files found.
libavcodec/resample2.c
View file @
a67cb012
...
...
@@ -207,8 +207,10 @@ AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_size,
memcpy
(
&
c
->
filter_bank
[
c
->
filter_length
*
phase_count
+
1
],
c
->
filter_bank
,
(
c
->
filter_length
-
1
)
*
sizeof
(
FELEM
));
c
->
filter_bank
[
c
->
filter_length
*
phase_count
]
=
c
->
filter_bank
[
c
->
filter_length
-
1
];
c
->
src_incr
=
out_rate
;
c
->
ideal_dst_incr
=
c
->
dst_incr
=
in_rate
*
phase_count
;
if
(
!
av_reduce
(
&
c
->
src_incr
,
&
c
->
dst_incr
,
out_rate
,
in_rate
*
(
int64_t
)
phase_count
,
INT32_MAX
/
2
))
goto
error
;
c
->
ideal_dst_incr
=
c
->
dst_incr
;
c
->
index
=
-
phase_count
*
((
c
->
filter_length
-
1
)
/
2
);
return
c
;
...
...
libswresample/resample2.c
View file @
a67cb012
...
...
@@ -224,8 +224,10 @@ AVResampleContext *swr_resample_init(AVResampleContext *c, int out_rate, int in_
}
c
->
compensation_distance
=
0
;
c
->
src_incr
=
out_rate
;
c
->
ideal_dst_incr
=
c
->
dst_incr
=
in_rate
*
phase_count
;
if
(
!
av_reduce
(
&
c
->
src_incr
,
&
c
->
dst_incr
,
out_rate
,
in_rate
*
(
int64_t
)
phase_count
,
INT32_MAX
/
2
))
goto
error
;
c
->
ideal_dst_incr
=
c
->
dst_incr
;
c
->
index
=
-
phase_count
*
((
c
->
filter_length
-
1
)
/
2
);
c
->
frac
=
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