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
1b9ca38d
Commit
1b9ca38d
authored
Oct 27, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resample2: fix potential overflow
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
a67cb012
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
resample2.c
libavcodec/resample2.c
+2
-3
resample2.c
libswresample/resample2.c
+2
-3
No files found.
libavcodec/resample2.c
View file @
1b9ca38d
...
...
@@ -248,10 +248,9 @@ int av_resample(AVResampleContext *c, short *dst, short *src, int *consumed, int
dst
[
dst_index
]
=
src
[
index2
>>
32
];
index2
+=
incr
;
}
frac
+=
dst_index
*
dst_incr_frac
;
index
+=
dst_index
*
dst_incr
;
index
+=
frac
/
c
->
src_incr
;
frac
%=
c
->
src_incr
;
index
+=
(
frac
+
dst_index
*
(
int64_t
)
dst_incr_frac
)
/
c
->
src_incr
;
frac
=
(
frac
+
dst_index
*
(
int64_t
)
dst_incr_frac
)
%
c
->
src_incr
;
}
else
{
for
(
dst_index
=
0
;
dst_index
<
dst_size
;
dst_index
++
){
FELEM
*
filter
=
c
->
filter_bank
+
c
->
filter_length
*
(
index
&
c
->
phase_mask
);
...
...
libswresample/resample2.c
View file @
1b9ca38d
...
...
@@ -269,10 +269,9 @@ int swr_resample(AVResampleContext *c, short *dst, const short *src, int *consum
dst
[
dst_index
]
=
src
[
index2
>>
32
];
index2
+=
incr
;
}
frac
+=
dst_index
*
dst_incr_frac
;
index
+=
dst_index
*
dst_incr
;
index
+=
frac
/
c
->
src_incr
;
frac
%=
c
->
src_incr
;
index
+=
(
frac
+
dst_index
*
(
int64_t
)
dst_incr_frac
)
/
c
->
src_incr
;
frac
=
(
frac
+
dst_index
*
(
int64_t
)
dst_incr_frac
)
%
c
->
src_incr
;
}
else
{
for
(
dst_index
=
0
;
dst_index
<
dst_size
;
dst_index
++
){
FELEM
*
filter
=
c
->
filter_bank
+
c
->
filter_length
*
(
index
&
c
->
phase_mask
);
...
...
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