[FFmpeg-cvslog] ffprobe: print format long_name only if non-NULL

Stefano Sabatini git at videolan.org
Fri Sep 21 14:00:16 CEST 2012


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Fri Sep 21 13:58:26 2012 +0200| [9543cd593ed8249e9885598fc53de163c9d4e2d3] | committer: Stefano Sabatini

ffprobe: print format long_name only if non-NULL

Fix possible crash when long_name is not defined (for example if
--enable-small).

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9543cd593ed8249e9885598fc53de163c9d4e2d3
---

 ffprobe.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ffprobe.c b/ffprobe.c
index 5078365..f6f5b8d 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -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);



More information about the ffmpeg-cvslog mailing list