diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-08-16 01:59:50 +0200 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-08-16 17:00:49 +0200 |
commit | a7196795613f2cd416cf2c51c767a1125e27b057 (patch) | |
tree | 1c0178c8701d3819a10f82df53bc333a8cc8cc31 /libavfilter | |
parent | 47219e1c0c2f8a159e70b58e6293c169c7dd62cc (diff) | |
download | ffmpeg-a7196795613f2cd416cf2c51c767a1125e27b057.tar.gz |
lavfi: complain and exit for invalid named values in ff_parse_packing_format()
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/formats.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavfilter/formats.c b/libavfilter/formats.c index d121b3b4bf..c863be638d 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c @@ -283,8 +283,11 @@ int ff_parse_packing_format(int *ret, const char *arg, void *log_ctx) char *tail; int planar = strtol(arg, &tail, 10); if (*tail) { - planar = (strcmp(arg, "packed") != 0); - } else if (planar != 0 && planar != 1) { + planar = !strcmp(arg, "packed") ? 0: + !strcmp(arg, "planar") ? 1: -1; + } + + if (planar != 0 && planar != 1) { av_log(log_ctx, AV_LOG_ERROR, "Invalid packing format '%s'\n", arg); return AVERROR(EINVAL); } |