]> git.sesse.net Git - ffmpeg/commitdiff
tools/target_dec_fuzzer: assume that discarded audio packets produced max samples
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 25 Sep 2020 22:14:46 +0000 (00:14 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 18 Oct 2020 19:27:23 +0000 (21:27 +0200)
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>
tools/target_dec_fuzzer.c

index db1c6d35a6cceab89e8863f6c8a20c40e8362511..6b75e006e68fa1a3518c0962084b7aaaadcf80e4 100644 (file)
@@ -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;