summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-09-26 00:14:46 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-10-18 21:27:23 +0200
commitc0c6b68ddbe6f7d35e2cb62a7c44970f9475eddd (patch)
tree56489ae13460ff6ea067288765d35c936cda3e84 /tools
parentc062dd74d7b12f661cd2ccde832bb27b990aee82 (diff)
tools/target_dec_fuzzer: assume that discarded audio packets produced max samples
We do not know how many samples these produce as its not exported. Alternatively we could export that but as long as its not we better assume its more than 0 as otherwise the thresholds would not work Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'tools')
-rw-r--r--tools/target_dec_fuzzer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index db1c6d35a6..6b75e006e6 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -344,6 +344,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (ec_pixels > maxpixels)
goto maximums_reached;
+ if (ctx->codec_type == AVMEDIA_TYPE_AUDIO &&
+ frame->nb_samples == 0 && !got_frame &&
+ (avpkt.flags & AV_PKT_FLAG_DISCARD))
+ nb_samples += ctx->max_samples;
+
nb_samples += frame->nb_samples;
if (nb_samples > maxsamples)
goto maximums_reached;