aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2024-04-26 13:19:26 +0200
committerNiklas Haas <git@haasn.dev>2024-12-23 14:23:13 +0100
commitd23f443dfcad65c7abff728f7835d5fb78654393 (patch)
tree2a382940e3ff03cfffadea8078e2f95d3d84a2dd
parenteecdc25d4b7c6be368be38279880ed38fc3e1bd2 (diff)
downloadffmpeg-d23f443dfcad65c7abff728f7835d5fb78654393.tar.gz
avfilter/vf_lut*: strip color volume metadata
These filters, in general, will apply some arbitrary color volume transformation. Strip corresponding metadata to be conservative/safe.
-rw-r--r--libavfilter/vf_lut.c3
-rw-r--r--libavfilter/vf_lut2.c2
-rw-r--r--libavfilter/vf_lut3d.c3
3 files changed, 8 insertions, 0 deletions
diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c
index af7172dc01..c227ebc45c 100644
--- a/libavfilter/vf_lut.c
+++ b/libavfilter/vf_lut.c
@@ -539,6 +539,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
av_frame_copy_props(out, in);
}
+ av_frame_side_data_remove_by_props(&out->side_data, &out->nb_side_data,
+ AV_SIDE_DATA_PROP_COLOR_DEPENDENT);
+
if (s->is_rgb && s->is_16bit && !s->is_planar) {
/* packed, 16-bit */
PACKED_THREAD_DATA
diff --git a/libavfilter/vf_lut2.c b/libavfilter/vf_lut2.c
index 88b45f45e5..2bbdd0a288 100644
--- a/libavfilter/vf_lut2.c
+++ b/libavfilter/vf_lut2.c
@@ -619,6 +619,8 @@ static int tlut2_filter_frame(AVFilterLink *inlink, AVFrame *frame)
}
av_frame_copy_props(out, frame);
+ av_frame_side_data_remove_by_props(&out->side_data, &out->nb_side_data,
+ AV_SIDE_DATA_PROP_COLOR_DEPENDENT);
td.out = out;
td.srcx = frame;
diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c
index 46955b99a5..3c2a8812e8 100644
--- a/libavfilter/vf_lut3d.c
+++ b/libavfilter/vf_lut3d.c
@@ -1178,6 +1178,9 @@ static AVFrame *apply_lut(AVFilterLink *inlink, AVFrame *in)
av_frame_copy_props(out, in);
}
+ av_frame_side_data_remove_by_props(&out->side_data, &out->nb_side_data,
+ AV_SIDE_DATA_PROP_COLOR_DEPENDENT);
+
td.in = in;
td.out = out;
ff_filter_execute(ctx, lut3d->interp, &td, NULL,