aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-01-31 22:26:01 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-01-31 23:43:41 +0100
commit8bdba1092f50d52e0af90f425811302ec91152f8 (patch)
tree86aa511a74fac09643105b888dd7acf536d8748d
parent1df08cae82d75e01b1250bb9416d6cfbab430e82 (diff)
downloadffmpeg-8bdba1092f50d52e0af90f425811302ec91152f8.tar.gz
tools/target_dec_fuzzer: Only audio uses the return value to decode packets in pieces, correct the code to match that
Fixes: Timeout Fixes: 483/fuzz-0-ffmpeg_VIDEO_AV_CODEC_ID_H263I_fuzzer Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--tools/target_dec_fuzzer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index 533aa37376..8761d96454 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -186,6 +186,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (ret <= 0 || ret > avpkt.size)
break;
+ if (ctx->codec_type != AVMEDIA_TYPE_AUDIO)
+ ret = avpkt.size;
avpkt.data += ret;
avpkt.size -= ret;
}