Yes, OpenCV (including other 3rd party tools that come with it like libpng) does not call inflateGetHeader().
But security scanning tools detect zlib 1.2.12 and produce a positive result, which is an issue with customers when OpenCV is part of a commercial application (even when it’s a false positive).
I was able to build OpenCV (version 4.5.3) with zlib 1.2.13. Tests showed no regressions. So, it might be just a matter of replacing zlib 1.2.12 with zlib 1.2.13.