libheif versions from 1.16.0 up to but not including 1.23.4 contain an uncontrolled recursion vulnerability in the function HeifFile::check_for_ref_cycle_recursion(). This flaw allows attackers to crash the process by supplying a crafted HEIF or AVIF file with a long chain of 'dimg' references, leading to stack exhaustion and a segmentation fault during file reading.