[FFmpeg-devel] [PATCH v2 2/3] avfilter/vf_iccdetect: use ff_icc_profile_sanitize

Niklas Haas ffmpeg at haasn.xyz
Thu Sep 28 18:10:40 EEST 2023


From: Niklas Haas <git at haasn.dev>

---
 libavfilter/vf_iccdetect.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_iccdetect.c b/libavfilter/vf_iccdetect.c
index 5288b0320d2..16eacbbb560 100644
--- a/libavfilter/vf_iccdetect.c
+++ b/libavfilter/vf_iccdetect.c
@@ -93,7 +93,9 @@ static int iccdetect_filter_frame(AVFilterLink *inlink, AVFrame *frame)
     if (!profile)
         return AVERROR_INVALIDDATA;
 
-    ret = ff_icc_profile_read_primaries(&s->icc, profile, &coeffs);
+    ret = ff_icc_profile_sanitize(&s->icc, profile);
+    if (!ret)
+        ret = ff_icc_profile_read_primaries(&s->icc, profile, &coeffs);
     if (!ret)
         ret = ff_icc_profile_detect_transfer(&s->icc, profile, &s->profile_trc);
     cmsCloseProfile(profile);
-- 
2.42.0



More information about the ffmpeg-devel mailing list