From: stefano Date: Thu, 19 Mar 2009 22:29:32 +0000 (+0000) Subject: Make ffmpeg fail if the argument provided to the -pix_fmt option is X-Git-Url: http://rtime.felk.cvut.cz/gitweb/frescor/ffmpeg.git/commitdiff_plain/18a411baac6de9be4c86da5b492804938a2ecc01 Make ffmpeg fail if the argument provided to the -pix_fmt option is invalid. git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18053 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b --- diff --git a/ffmpeg.c b/ffmpeg.c index 99335f86e..14aa07ee8 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -2536,9 +2536,13 @@ static void list_fmts(void (*get_fmt_string)(char *buf, int buf_size, int fmt), static void opt_frame_pix_fmt(const char *arg) { - if (strcmp(arg, "list")) + if (strcmp(arg, "list")) { frame_pix_fmt = avcodec_get_pix_fmt(arg); - else { + if (frame_pix_fmt == PIX_FMT_NONE) { + fprintf(stderr, "Unknown pixel format requested: %s\n", arg); + av_exit(1); + } + } else { list_fmts(avcodec_pix_fmt_string, PIX_FMT_NB); av_exit(0); }