From bc398382ac554717a037bc08c18a742382fe1659 Mon Sep 17 00:00:00 2001 From: Mirco Miranda Date: Thu, 23 Apr 2026 11:42:16 +0200 Subject: [PATCH] EXR: fix Null-dereference READ in OpenEXR --- src/imageformats/exr.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/imageformats/exr.cpp b/src/imageformats/exr.cpp index 3cedc32..fc0cc0f 100644 --- a/src/imageformats/exr.cpp +++ b/src/imageformats/exr.cpp @@ -236,11 +236,12 @@ static QStringList viewList(const Imf::Header &h) { QStringList l; if (auto views = h.findTypedAttribute("multiView")) { + // Internally OpenEXR first checks if the multiView attribute is present: + // if present, I have no other layers. for (auto &&v : views->value()) { l << QString::fromStdString(v); } - } - if (l.isEmpty()) { + } else { // Recent versions of Photoshop save images by setting the layer. // Channels are named Layer 1.A, Layer 1.B, etc., so I have to set // the layer or the images will appear black.