1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

ffprobe: print codec_long_name only when available

Avoid possible segmentation fault if codec_long_name is defined as
NULL (for example if --enable-small).
This commit is contained in:
Stefano Sabatini 2012-09-21 09:25:46 +02:00
parent fb96ac469a
commit 0f40105aaa

View File

@ -1656,7 +1656,8 @@ static void show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_i
const char *profile = NULL; const char *profile = NULL;
if ((dec = dec_ctx->codec)) { if ((dec = dec_ctx->codec)) {
print_str("codec_name", dec->name); print_str("codec_name", dec->name);
print_str("codec_long_name", dec->long_name); if (dec->long_name) print_str ("codec_long_name", dec->long_name);
else print_str_opt("codec_long_name", "unknown");
} else { } else {
print_str_opt("codec_name", "unknown"); print_str_opt("codec_name", "unknown");
print_str_opt("codec_long_name", "unknown"); print_str_opt("codec_long_name", "unknown");