tools/target_dec_fuzzer: Do not corrupt the packet size return
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 25 Aug 2019 18:41:57 +0000 (20:41 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 26 Aug 2019 08:36:40 +0000 (10:36 +0200)
Fixes: Timeout (infinite)
Fixes: 16732/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-5642166377906176

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tools/target_dec_fuzzer.c

index 7bf25608ba86ae0ca543e6b7fbbcfc2859c88e9d..9dd6a5ef0bfc4eb63dadec449409ed7cde9e3d5f 100644 (file)
@@ -219,8 +219,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
                     if (!avpkt.buf)
                         error("Failed memory allocation");
                 } else {
-                    ret = av_packet_make_refcounted(&avpkt);
-                    if (ret < 0)
+                    if (av_packet_make_refcounted(&avpkt) < 0)
                         error("Failed memory allocation");
                 }
                 parsepkt.data += ret;