summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorMark Reid <mindmark@gmail.com>2020-09-05 14:13:01 -0700
committerPaul B Mahol <onemda@gmail.com>2020-09-07 19:04:09 +0200
commit5fcd83a244f26bcd9860e52a5bbcd53d8a8f89e6 (patch)
treed1b25649befc4be040def09846f070fba512cd8e /libavfilter
parent03415f25d295b1e16d07851a773ff30280dc8b9e (diff)
avfilter/vf_lut3d: support remaping negative values in the prelut
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_lut3d.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c
index 6730a424ce..988f6c8b55 100644
--- a/libavfilter/vf_lut3d.c
+++ b/libavfilter/vf_lut3d.c
@@ -878,18 +878,16 @@ static int parse_cinespace(AVFilterContext *ctx, FILE *f)
prelut_sizes[i] = npoints;
in_min[i] = FLT_MAX;
- in_max[i] = FLT_MIN;
+ in_max[i] = -FLT_MAX;
out_min[i] = FLT_MAX;
- out_max[i] = FLT_MIN;
-
- last = FLT_MIN;
+ out_max[i] = -FLT_MAX;
for (int j = 0; j < npoints; j++) {
NEXT_FLOAT_OR_GOTO(v, end)
in_min[i] = FFMIN(in_min[i], v);
in_max[i] = FFMAX(in_max[i], v);
in_prelut[i][j] = v;
- if (v < last) {
+ if (j > 0 && v < last) {
av_log(ctx, AV_LOG_ERROR, "Invalid file, non increasing prelut.\n");
ret = AVERROR(ENOMEM);
goto end;