Commit 6bae366f authored by Felicia Lim's avatar Felicia Lim
Browse files

opus_decoder_fuzzer: limit the number of decodes to avoid timeout

parent b83dd528
Pipeline #2114 passed with stage
in 4 minutes and 50 seconds
...@@ -40,6 +40,8 @@ ...@@ -40,6 +40,8 @@
/* 4 bytes: packet length, 4 bytes: encoder final range */ /* 4 bytes: packet length, 4 bytes: encoder final range */
#define SETUP_BYTE_COUNT 8 #define SETUP_BYTE_COUNT 8
#define MAX_DECODES 12
typedef struct { typedef struct {
int fs; int fs;
int channels; int channels;
...@@ -66,6 +68,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { ...@@ -66,6 +68,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
TocInfo toc; TocInfo toc;
int i = 0; int i = 0;
int err = OPUS_OK; int err = OPUS_OK;
int num_decodes = 0;
/* Not enough data to setup the decoder (+1 for the ToC) */ /* Not enough data to setup the decoder (+1 for the ToC) */
if (size < SETUP_BYTE_COUNT + 1) { if (size < SETUP_BYTE_COUNT + 1) {
...@@ -82,7 +85,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { ...@@ -82,7 +85,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
pcm = (opus_int16*) malloc(sizeof(*pcm) * MAX_FRAME_SAMP * toc.channels); 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; int len, fec;
len = (opus_uint32) data[i ] << 24 | len = (opus_uint32) data[i ] << 24 |
......
  • Any plans to make new release?

    it is already +1 year since last release and many commits in the git tree ..

Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment