[FFmpeg-cvslog] ffprobe: print codec_long_name only when available

Stefano Sabatini git at videolan.org
Fri Sep 21 09:31:47 CEST 2012


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Fri Sep 21 09:25:46 2012 +0200| [0f40105aaa8295c47bd4b07fcca5b5b4f1d4ffb4] | committer: Stefano Sabatini

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).

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

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

diff --git a/ffprobe.c b/ffprobe.c
index 01576c1..5078365 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");



More information about the ffmpeg-cvslog mailing list