summaryrefslogtreecommitdiff
path: root/ffprobe.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-09-21 09:25:46 +0200
committerStefano Sabatini <stefasab@gmail.com>2012-09-21 09:27:06 +0200
commit0f40105aaa8295c47bd4b07fcca5b5b4f1d4ffb4 (patch)
tree24ad63de504b5298e29a90c7ac9555f88893e9f2 /ffprobe.c
parentfb96ac469a1d375b473868984f832e3a7cdfc24c (diff)
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).
Diffstat (limited to 'ffprobe.c')
-rw-r--r--ffprobe.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ffprobe.c b/ffprobe.c
index 01576c1476..5078365413 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -1656,7 +1656,8 @@ static void show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_i
const char *profile = NULL;
if ((dec = dec_ctx->codec)) {
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 {
print_str_opt("codec_name", "unknown");
print_str_opt("codec_long_name", "unknown");