Message ID | 20220224003926.3150-1-jamrial@gmail.com |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel] tools/target_bsf_fuzzer: simplify the loop feeding packets to the filter | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_aarch64_jetson | success | Make finished |
andriy/make_fate_aarch64_jetson | success | Make fate finished |
andriy/make_armv7_RPi4 | success | Make finished |
andriy/make_fate_armv7_RPi4 | success | Make fate finished |
diff --git a/tools/target_bsf_fuzzer.c b/tools/target_bsf_fuzzer.c index d6aaee3bd9..1aae4a12e5 100644 --- a/tools/target_bsf_fuzzer.c +++ b/tools/target_bsf_fuzzer.c @@ -146,16 +146,13 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { av_bsf_flush(bsf); flushpattern = (flushpattern >> 3) + (flushpattern << 61); - while (in->size) { - res = av_bsf_send_packet(bsf, in); - if (res < 0 && res != AVERROR(EAGAIN)) - break; - res = av_bsf_receive_packet(bsf, out); - if (res < 0) - break; - av_packet_unref(out); + res = av_bsf_send_packet(bsf, in); + if (res < 0) { + av_packet_unref(in); + continue; } - av_packet_unref(in); + while ((res = av_bsf_receive_packet(bsf, out)) >= 0); + av_packet_unref(out); } res = av_bsf_send_packet(bsf, NULL);
This also follows the suggested API usage in the doxy. Signed-off-by: James Almer <jamrial@gmail.com> --- tools/target_bsf_fuzzer.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)