[FFmpeg-cvslog] commit: Make opt_audio_sample_fmt() abort in case of invalid sample format (Stefano Sabatini )

git at videolan.org git
Fri Jan 14 23:11:15 CET 2011


ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Fri Jan 14 20:58:51 2011 +0000| [6c18f1cda2e2b2471ebf75d30d552cb0cb61b6ad] | committer: Stefano Sabatini 

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

Originally committed as revision 26335 to svn://svn.ffmpeg.org/ffmpeg/trunk

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

 ffmpeg.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 9c434b2..d2a7b6a 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2877,9 +2877,13 @@ static int opt_thread_count(const char *opt, const char *arg)
 
 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