]> git.sesse.net Git - ffmpeg/commitdiff
tools/target_dec_fuzzer: count all video decoding failures in the new API
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 2 Feb 2021 18:10:26 +0000 (19:10 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 16 Feb 2021 18:02:24 +0000 (19:02 +0100)
The next commit depends on this

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tools/target_dec_fuzzer.c

index d987aecd21939ddd08e1584af962db281a467312..d4b9f419dea23abb0d7bfecf214e870a7c0bb894 100644 (file)
@@ -352,6 +352,13 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
           if (ctx->codec_type != AVMEDIA_TYPE_SUBTITLE) {
               int ret = avcodec_send_packet(ctx, &avpkt);
               decode_more = ret >= 0;
+              if(!decode_more) {
+                    ec_pixels += (ctx->width + 32LL) * (ctx->height + 32LL);
+                    if (it > 20 || ec_pixels > 4 * ctx->max_pixels)
+                        ctx->error_concealment = 0;
+                    if (ec_pixels > maxpixels)
+                        goto maximums_reached;
+              }
           } else
               decode_more = 1;