Commit a7196795 authored by Stefano Sabatini's avatar Stefano Sabatini

lavfi: complain and exit for invalid named values in ff_parse_packing_format()

parent 47219e1c
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment