Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Opus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexander Traud
Opus
Commits
6bae366f
Commit
6bae366f
authored
4 years ago
by
Felicia Lim
Browse files
Options
Downloads
Patches
Plain Diff
opus_decoder_fuzzer: limit the number of decodes to avoid timeout
parent
b83dd528
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/opus_decode_fuzzer.c
+4
-1
4 additions, 1 deletion
tests/opus_decode_fuzzer.c
with
4 additions
and
1 deletion
tests/opus_decode_fuzzer.c
+
4
−
1
View file @
6bae366f
...
...
@@ -40,6 +40,8 @@
/* 4 bytes: packet length, 4 bytes: encoder final range */
#define SETUP_BYTE_COUNT 8
#define MAX_DECODES 12
typedef
struct
{
int
fs
;
int
channels
;
...
...
@@ -66,6 +68,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
TocInfo
toc
;
int
i
=
0
;
int
err
=
OPUS_OK
;
int
num_decodes
=
0
;
/* Not enough data to setup the decoder (+1 for the ToC) */
if
(
size
<
SETUP_BYTE_COUNT
+
1
)
{
...
...
@@ -82,7 +85,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
pcm
=
(
opus_int16
*
)
malloc
(
sizeof
(
*
pcm
)
*
MAX_FRAME_SAMP
*
toc
.
channels
);
while
(
i
+
SETUP_BYTE_COUNT
<
size
)
{
while
(
i
+
SETUP_BYTE_COUNT
<
size
&&
num_decodes
++
<
MAX_DECODES
)
{
int
len
,
fec
;
len
=
(
opus_uint32
)
data
[
i
]
<<
24
|
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment