]> git.sesse.net Git - ffmpeg/commitdiff
tools/target_dem_fuzzer: switch to the iterate API
authorJames Almer <jamrial@gmail.com>
Sat, 10 Oct 2020 02:59:40 +0000 (23:59 -0300)
committerJames Almer <jamrial@gmail.com>
Mon, 19 Oct 2020 14:54:46 +0000 (11:54 -0300)
Signed-off-by: James Almer <jamrial@gmail.com>
tools/target_dem_fuzzer.c

index a4d69bb230c8e76aba6c4c28539ef01b39e1997f..8c9e373367dd9bc564de539f3109890f716380d5 100644 (file)
@@ -112,8 +112,6 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
 #endif
 
     if (!c) {
-        av_register_all();
-        avcodec_register_all();
         av_log_set_level(AV_LOG_PANIC);
         c=1;
     }
@@ -139,15 +137,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;