Signed-off-by: Simon Thelen <ffmpeg-...@c-14.de> --- libavfilter/formats.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/libavfilter/formats.c b/libavfilter/formats.c index 4f9773b..2d3b859 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c @@ -637,20 +637,12 @@ int ff_parse_channel_layout(int64_t *ret, int *nret, const char *arg, void *log_ctx) { char *tail; - int64_t chlayout, count; - - if (nret) { - count = strtol(arg, &tail, 10); - if (*tail == 'c' && !tail[1] && count > 0 && count < 63) { - *nret = count; - *ret = 0; - return 0; - } - } + int64_t chlayout; + chlayout = av_get_channel_layout(arg); if (chlayout == 0) { chlayout = strtol(arg, &tail, 10); - if (*tail || chlayout == 0) { + if (!(*tail == '\0' || *tail == 'c' && *(tail + 1) == '\0') || chlayout == 0) { av_log(log_ctx, AV_LOG_ERROR, "Invalid channel layout '%s'\n", arg); return AVERROR(EINVAL); } -- 2.4.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel