CVE-2020-16588
Description
A Null Pointer Deference issue exists in Academy Software Foundation OpenEXR 2.3.0 in generatePreview in makePreview.cpp that can cause a denial of service via a crafted EXR file.
Affected products
10- Academy Software Foundation/OpenEXRdescription
- osv-coords8 versionspkg:rpm/opensuse/openexr&distro=openSUSE%20Leap%2015.1pkg:rpm/opensuse/openexr&distro=openSUSE%20Leap%2015.2pkg:rpm/suse/openexr&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Desktop%20Applications%2015%20SP1pkg:rpm/suse/openexr&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Desktop%20Applications%2015%20SP2pkg:rpm/suse/openexr&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP5pkg:rpm/suse/openexr&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP5pkg:rpm/suse/openexr&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP5pkg:rpm/suse/openexr&distro=SUSE%20Linux%20Enterprise%20Workstation%20Extension%2012%20SP5
< 2.2.1-lp151.4.15.1+ 7 more
- (no CPE)range: < 2.2.1-lp151.4.15.1
- (no CPE)range: < 2.2.1-lp152.7.8.1
- (no CPE)range: < 2.2.1-3.21.1
- (no CPE)range: < 2.2.1-3.21.1
- (no CPE)range: < 2.1.0-6.26.1
- (no CPE)range: < 2.1.0-6.26.1
- (no CPE)range: < 2.1.0-6.26.1
- (no CPE)range: < 2.1.0-6.26.1
Patches
Vulnerability mechanics
Root cause
"Division by zero when preview image dimensions are exactly 1 pixel, because the guard condition checked for > 0 instead of > 1."
Attack vector
An attacker crafts a malicious EXR file that causes `generatePreview` to compute a preview image dimension of exactly 1 pixel in height or width. When the function calculates the scaling factors `fx` and `fy`, the divisor `(previewWidth - 1)` or `(previewHeight - 1)` becomes zero, triggering a division-by-zero. This results in a null pointer dereference and a denial of service. No authentication or special network access is required beyond delivering the crafted file to an application that uses OpenEXR's preview generation.
Affected code
The vulnerability is in `OpenEXR/exrmakepreview/makePreview.cpp` in the `generatePreview` function. The faulty lines compute scaling factors `fx` and `fy` using `(previewWidth - 1)` and `(previewHeight - 1)` as divisors, but the guard condition only checks for `> 0` instead of `> 1`. When a crafted EXR file produces a preview image that is exactly 1 pixel high or 1 pixel wide, the divisor becomes zero, leading to a division-by-zero that manifests as a null pointer dereference.
What the fix does
The patch changes the guard conditions from `(previewWidth > 0)` to `(previewWidth > 1)` and from `(previewHeight > 0)` to `(previewHeight > 1)`. This ensures that the division `(w - 1) / (previewWidth - 1)` and `(h - 1) / (previewHeight - 1)` only executes when the divisor is at least 1 (i.e., the preview dimension is at least 2). When the preview dimension is exactly 1, the scaling factor is safely set to 1, avoiding the division-by-zero that caused the null pointer dereference.
Preconditions
- inputThe attacker must supply a crafted EXR file that results in a preview image of exactly 1 pixel in height or width.
- configThe victim application must call generatePreview on the crafted file.
Generated on Jun 19, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
3News mentions
0No linked articles in our index yet.