Inf values in template matching

Hi all,
I’m using the TM CCOEFF NORMED method for template matching and sometimes get negative and positive infinity. Is this normal? OpenCV 4.5.3

“sometimes”? minimal reproducible example please.