diff mbox series

[FFmpeg-devel,5/6] tools/target_dem_fuzzer: switch to the iterate API

Message ID 20201010034552.21874-1-jamrial@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,1/3] avdevice/alldevices: stop using deprecated linked list API | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished

Commit Message

James Almer Oct. 10, 2020, 3:45 a.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 tools/target_dem_fuzzer.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Anton Khirnov Oct. 19, 2020, 2:58 p.m. UTC | #1
Quoting James Almer (2020-10-10 05:45:52)
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  tools/target_dem_fuzzer.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)

LGTM
diff mbox series

Patch

diff --git a/tools/target_dem_fuzzer.c b/tools/target_dem_fuzzer.c
index eefb5c5fa3..10082993fe 100644
--- a/tools/target_dem_fuzzer.c
+++ b/tools/target_dem_fuzzer.c
@@ -105,8 +105,6 @@  int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
     int ret;
 
     if (!c) {
-        av_register_all();
-        avcodec_register_all();
         av_log_set_level(AV_LOG_PANIC);
         c=1;
     }
@@ -132,15 +130,17 @@  int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
         filesize       = bytestream2_get_le64(&gbc) & 0x7FFFFFFFFFFFFFFF;
 
         if ((flags & 2) && strlen(filename) < sizeof(filename) / 2) {
-            AVInputFormat *avif = NULL;
+            const AVInputFormat *avif = NULL;
+            void *avif_iter = NULL;
             int avif_count = 0;
-            while ((avif = av_iformat_next(avif))) {
+            while ((avif = av_demuxer_iterate(&avif_iter))) {
                 if (avif->extensions)
                     avif_count ++;
             }
             avif_count =  bytestream2_get_le32(&gbc) % avif_count;
 
-            while ((avif = av_iformat_next(avif))) {
+            avif_iter = NULL;
+            while ((avif = av_demuxer_iterate(&avif_iter))) {
                 if (avif->extensions)
                     if (!avif_count--)
                         break;