summaryrefslogtreecommitdiff
path: root/tools/target_dec_fuzzer.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-02-02 19:10:26 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-02-16 19:02:24 +0100
commit887bd6b02f6fbcc55a27dae31729efb0b769d5e0 (patch)
tree61ef7e8c55cd635e17204e93648b9eebe77d659f /tools/target_dec_fuzzer.c
parentd558c9f2375fd2136d20422cb1119cfbf872abeb (diff)
tools/target_dec_fuzzer: count all video decoding failures in the new API
The next commit depends on this Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'tools/target_dec_fuzzer.c')
-rw-r--r--tools/target_dec_fuzzer.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index d987aecd21..d4b9f419de 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -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;