Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tim-Philipp Müller
Opus
Commits
43c260ba
Commit
43c260ba
authored
Mar 30, 2011
by
Jean-Marc Valin
Browse files
Implementing bit-stream padding
parent
940931e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/opus_decoder.c
View file @
43c260ba
...
...
@@ -398,6 +398,22 @@ int opus_decode(OpusDecoder *st, const unsigned char *data,
if
(
st
->
frame_size
*
count
*
25
>
3
*
st
->
Fs
)
return
OPUS_CORRUPTED_DATA
;
len
--
;
/* Padding bit */
if
(
ch
&
0x40
)
{
int
padding
=
0
;
int
p
;
do
{
if
(
len
<=
0
)
return
OPUS_CORRUPTED_DATA
;
p
=
*
data
++
;
len
--
;
padding
+=
p
==
255
?
254
:
p
;
}
while
(
p
==
255
);
len
-=
padding
;
}
if
(
len
<
0
)
return
OPUS_CORRUPTED_DATA
;
/* Bit 7 is VBR flag (bit 6 is ignored) */
if
(
ch
&
0x80
)
{
...
...
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