]> git.sesse.net Git - ffmpeg/blobdiff - tools/target_dec_fuzzer.c
avcodec/eatqi: Fix runtime error: signed integer overflow: 4466147 * 1075 cannot...
[ffmpeg] / tools / target_dec_fuzzer.c
index 5a0b53e546a55e4ed3576ec9110b6715707b3464..ed6e2429b1d0f204a0b54dd70d55f631a1604914 100644 (file)
@@ -67,7 +67,6 @@ static AVCodec *AVCodecInitialize(enum AVCodecID codec_id)
 {
     AVCodec *res;
 
-    av_log_set_level(AV_LOG_PANIC);
     res = avcodec_find_decoder(codec_id);
     if (!res)
         error("Failed to find decoder");
@@ -146,13 +145,17 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
 #define DECODER_SYMBOL(CODEC) DECODER_SYMBOL0(CODEC)
         extern AVCodec DECODER_SYMBOL(FFMPEG_DECODER);
         avcodec_register(&DECODER_SYMBOL(FFMPEG_DECODER));
-        int codec_id = DECODER_SYMBOL(FFMPEG_DECODER).id;
 
-        c = AVCodecInitialize(codec_id);  // Done once.
+        c = &DECODER_SYMBOL(FFMPEG_DECODER);
+
+        // Unsupported
+        if (c->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
+            return 0;
 #else
         avcodec_register_all();
         c = AVCodecInitialize(FFMPEG_CODEC);  // Done once.
 #endif
+        av_log_set_level(AV_LOG_PANIC);
     }
 
     switch (c->type) {