Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mark Harris
Opus
Commits
23340e22
Commit
23340e22
authored
Feb 03, 2011
by
Jean-Marc Valin
Browse files
Fixes an int overflow in the VBR code
Also properly applies the MDCT filtering for resampling
parent
75228782
Changes
1
Show whitespace changes
Inline
Side-by-side
libcelt/celt.c
View file @
23340e22
...
...
@@ -950,7 +950,8 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, i
if
(
st
->
vbr
)
{
vbr_rate
=
((
2
*
st
->
bitrate
*
frame_size
<<
BITRES
)
+
st
->
mode
->
Fs
)
/
(
2
*
st
->
mode
->
Fs
);
celt_int32
den
=
st
->
mode
->
Fs
>>
BITRES
;
vbr_rate
=
(
st
->
bitrate
*
frame_size
+
(
den
>>
1
))
/
den
;
effectiveBytes
=
vbr_rate
>>
3
;
}
else
{
celt_int32
tmp
;
...
...
@@ -2399,7 +2400,7 @@ int celt_decode_with_ec_float(CELTDecoder * restrict st, const unsigned char *da
int
bound
=
M
*
st
->
mode
->
eBands
[
effEnd
];
if
(
st
->
downsample
!=
1
)
bound
=
IMIN
(
bound
,
N
/
st
->
downsample
);
for
(
i
=
M
*
st
->
mode
->
eBands
[
effEnd
]
;
i
<
N
;
i
++
)
for
(
i
=
bound
;
i
<
N
;
i
++
)
freq
[
c
*
N
+
i
]
=
0
;
}
while
(
++
c
<
C
);
...
...
Write
Preview
Supports
Markdown
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