avcodec/decode: use ff_icc_profile_sanitize

Fixes: https://trac.ffmpeg.org/ticket/9673
This commit is contained in:
Niklas Haas 2023-09-27 11:49:57 +02:00
parent 443471356f
commit 0d596776c6

View File

@ -536,7 +536,9 @@ static int detect_colorspace(AVCodecContext *avctx, AVFrame *frame)
if (!profile)
return AVERROR_INVALIDDATA;
ret = ff_icc_profile_read_primaries(&avci->icc, profile, &coeffs);
ret = ff_icc_profile_sanitize(&avci->icc, profile);
if (!ret)
ret = ff_icc_profile_read_primaries(&avci->icc, profile, &coeffs);
if (!ret)
ret = ff_icc_profile_detect_transfer(&avci->icc, profile, &trc);
cmsCloseProfile(profile);