[FFmpeg-cvslog] r26335 - trunk/ffmpeg.c

stefano subversion
Fri Jan 14 21:58:52 CET 2011


Author: stefano
Date: Fri Jan 14 21:58:51 2011
New Revision: 26335

Log:
Make opt_audio_sample_fmt() abort in case of invalid sample format
name.

Modified:
   trunk/ffmpeg.c

Modified: trunk/ffmpeg.c
==============================================================================
--- trunk/ffmpeg.c	Fri Jan 14 21:58:47 2011	(r26334)
+++ trunk/ffmpeg.c	Fri Jan 14 21:58:51 2011	(r26335)
@@ -2877,9 +2877,13 @@ static int opt_thread_count(const char *
 
 static void opt_audio_sample_fmt(const char *arg)
 {
-    if (strcmp(arg, "list"))
+    if (strcmp(arg, "list")) {
         audio_sample_fmt = av_get_sample_fmt(arg);
-    else {
+        if (audio_sample_fmt == AV_SAMPLE_FMT_NONE) {
+            av_log(NULL, AV_LOG_ERROR, "Invalid sample format '%s'\n", arg);
+            ffmpeg_exit(1);
+        }
+    } else {
         list_fmts(av_get_sample_fmt_string, AV_SAMPLE_FMT_NB);
         ffmpeg_exit(0);
     }



More information about the ffmpeg-cvslog mailing list