[FFmpeg-cvslog] lavfi: complain and exit for invalid named values in ff_parse_packing_format()
Stefano Sabatini
git at videolan.org
Tue Aug 16 17:00:08 CEST 2011
ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Tue Aug 16 01:59:50 2011 +0200| [a7196795613f2cd416cf2c51c767a1125e27b057] | committer: Stefano Sabatini
lavfi: complain and exit for invalid named values in ff_parse_packing_format()
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a7196795613f2cd416cf2c51c767a1125e27b057
---
libavfilter/formats.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/libavfilter/formats.c b/libavfilter/formats.c
index d121b3b..c863be6 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);
}
More information about the ffmpeg-cvslog
mailing list