The patch works, thank you. But now I don't know how to test it...
The two images (wide-gamut and sRGB) show no differences; I don't see any messages about lcms in the terminal.

Another topic:
I found this GitHub repository that provides sample images for testing.

https://github.com/codelogic/wide-gamut-tests

I downloaded DCI-P3 and Rec.2020 images, but none of the programs I have can open them: CinGG; Krita; GIMP; Image viewers; Blender; Kdenlive; Shutter Encoder; Natron. I don't understand why—it's a format supported by FFmpeg and other programs.