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
Tim-Philipp Müller
Opus
Commits
71877da4
Commit
71877da4
authored
Mar 14, 2011
by
Jean-Marc Valin
Browse files
Error handling
parent
a7d31b7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/opus_decoder.c
View file @
71877da4
...
...
@@ -149,7 +149,7 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
if
(
audiosize
>
frame_size
)
{
fprintf
(
stderr
,
"PCM buffer too small: %d vs %d (mode = %d)
\n
"
,
audiosize
,
frame_size
,
mode
);
return
-
1
;
return
OPUS_BAD_ARG
;
}
else
{
frame_size
=
audiosize
;
}
...
...
@@ -315,7 +315,7 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
}
int
parse_size
(
const
unsigned
char
*
data
,
int
len
,
short
*
size
)
static
int
parse_size
(
const
unsigned
char
*
data
,
int
len
,
short
*
size
)
{
if
(
len
<
1
)
{
...
...
@@ -411,7 +411,8 @@ int opus_decode(OpusDecoder *st, const unsigned char *data,
}
break
;
}
/* FIXME: Check if the number of samples fits in the output buffer */
if
(
count
*
st
->
frame_size
>
frame_size
)
return
OPUS_BAD_ARG
;
nb_samples
=
0
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
...
...
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