Commit 13048344 authored by James Almer's avatar James Almer

fftools/opt_common: check the return value of av_hwdevice_get_type_name before printing it

It may be NULL, as is the case for D3D11VA_VLD.

Running "ffmpeg -h decoder=h264" on a Windows build

Before:
Decoder h264 [H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10]:
    Supported hardware devices: dxva2 (null) d3d11va cuda

After:
Decoder h264 [H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10]:
    Supported hardware devices: dxva2 d3d11va cuda
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 9903ba28
......@@ -335,9 +335,12 @@ static void print_codec(const AVCodec *c)
printf(" Supported hardware devices: ");
for (int i = 0;; i++) {
const AVCodecHWConfig *config = avcodec_get_hw_config(c, i);
const char *name;
if (!config)
break;
printf("%s ", av_hwdevice_get_type_name(config->device_type));
name = av_hwdevice_get_type_name(config->device_type);
if (name)
printf("%s ", name);
}
printf("\n");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment