mirror of https://git.ffmpeg.org/ffmpeg.git
lavfi: complain and exit for invalid named values in ff_parse_packing_format()
This commit is contained in:
parent
47219e1c0c
commit
a719679561
|
@ -283,8 +283,11 @@ int ff_parse_packing_format(int *ret, const char *arg, void *log_ctx)
|
||||||
char *tail;
|
char *tail;
|
||||||
int planar = strtol(arg, &tail, 10);
|
int planar = strtol(arg, &tail, 10);
|
||||||
if (*tail) {
|
if (*tail) {
|
||||||
planar = (strcmp(arg, "packed") != 0);
|
planar = !strcmp(arg, "packed") ? 0:
|
||||||
} else if (planar != 0 && planar != 1) {
|
!strcmp(arg, "planar") ? 1: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (planar != 0 && planar != 1) {
|
||||||
av_log(log_ctx, AV_LOG_ERROR, "Invalid packing format '%s'\n", arg);
|
av_log(log_ctx, AV_LOG_ERROR, "Invalid packing format '%s'\n", arg);
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue