tools/target_dec_fuzzer: Move the hwaccel check outside the initialization if
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 29 May 2017 01:37:43 +0000 (03:37 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 29 May 2017 01:40:47 +0000 (03:40 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tools/target_dec_fuzzer.c

index ed6e242..ec10480 100644 (file)
@@ -147,10 +147,6 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
         avcodec_register(&DECODER_SYMBOL(FFMPEG_DECODER));
 
         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.
@@ -158,6 +154,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
         av_log_set_level(AV_LOG_PANIC);
     }
 
+    // Unsupported
+    if (c->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
+        return 0;
+
     switch (c->type) {
     case AVMEDIA_TYPE_AUDIO   : decode_handler = avcodec_decode_audio4; break;
     case AVMEDIA_TYPE_VIDEO   : decode_handler = avcodec_decode_video2; break;