ffprobe: print format long_name only if non-NULL

Fix possible crash when long_name is not defined (for example if
--enable-small).
This commit is contained in:
Stefano Sabatini 2012-09-21 13:58:26 +02:00
parent 3aa1b53256
commit 9543cd593e
1 changed files with 2 additions and 1 deletions

View File

@ -1781,7 +1781,8 @@ static void show_format(WriterContext *w, AVFormatContext *fmt_ctx)
print_str("filename", fmt_ctx->filename);
print_int("nb_streams", fmt_ctx->nb_streams);
print_str("format_name", fmt_ctx->iformat->name);
print_str("format_long_name", fmt_ctx->iformat->long_name);
if (fmt_ctx->iformat->long_name) print_str ("format_long_name", fmt_ctx->iformat->long_name);
else print_str_opt("format_long_name", "unknown");
print_time("start_time", fmt_ctx->start_time, &AV_TIME_BASE_Q);
print_time("duration", fmt_ctx->duration, &AV_TIME_BASE_Q);
if (size >= 0) print_val ("size", size, unit_byte_str);