CVE-2026-32738: libheif has a Heap OOB Read/SEGV Crash via Zero samples_per_chunk
Last updated 19 June 2026
Other sources
libheif is a HEIF and AVIF file format decoder and encoder. In versions 1.21.2 and below, a crafted 792-byte HEIF sequence file with samplesperchunk=0 in the stsc box causes an unsigned integer underflow in the Chunk constructor (mlastsample = 0 + 0 - 1 = UINT32MAX), mapping all samples to an empty chunk and resulting in a denial of service. When any sample is accessed, the library reads from index 0 of an empty std::vector, causing a guaranteed SEGV (null-page read). The file parses successfully without producing an error; the crash occurs on the first frame access. This issue has been fixed in version 1.22.0.
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
libheifto a version that resolves this vulnerability.Fixed in 1.22.0
Event History
Frequently Asked Questions
What is the severity of CVE-2026-32738?
CVE-2026-32738 has a high severity rating due to the potential for a heap out-of-bounds read and subsequent crash.
How do I fix CVE-2026-32738?
To fix CVE-2026-32738, upgrade to libheif version 1.21.3 or later, which addresses the vulnerability.
What versions of libheif are affected by CVE-2026-32738?
CVE-2026-32738 affects libheif versions up to and including 1.21.2.
What kind of attack can exploit CVE-2026-32738?
An attacker can exploit CVE-2026-32738 by providing a crafted HEIF file that triggers the vulnerability.
Is CVE-2026-32738 specific to a certain file format?
Yes, CVE-2026-32738 specifically affects the HEIF and AVIF file formats processed by libheif.