Skip to contentSkip to conversation

libde265: patch CVE-2022-1253

PATCH New Gyorgy Sarvari 1 participant 14 messages Nov 28, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/14 libde265: patch CVE-2022-1253

Details: https://nvd.nist.gov/vuln/detail/CVE-2022-1253

Pick the patch from the nvd report.

The patch is only partially backported, because part of the vulnerable code was introuced only in a later version.

---
 .../libde265/libde265/CVE-2022-1253.patch     | 34 +++++++++++++++++++
 .../libde265/libde265_1.0.5.bb                |  4 ++-
 2 files changed, 37 insertions(+), 1 deletion(-)
 create mode 100644 meta-multimedia/recipes-multimedia/libde265/libde265/CVE-2022-1253.patch
meta-multimedia/recipes-multimedia/libde265/libde265/CVE-2022-1253.patch new file +34 -0
new file mode 100644
index 0000000000..57c86101fe
@@ -0,0 +1,34 @@
+From 4dcc28a63e12a6cc8b99bc8e96c5c764fc7a8f1d Mon Sep 17 00:00:00 2001
+From: Dirk Farin <[email protected]>
+Date: Tue, 5 Apr 2022 09:52:57 +0200
+Subject: [PATCH] error on out-of-range cpb_cnt_minus1 (oss-fuzz issue 27590)
+
+CVE: CVE-2022-1253
+Upstream-Status: Backport [https://github.com/strukturag/libde265/commit/8e89fe0e175d2870c39486fdd09250b230ec10b8]
+
+This is a partial backport of the linked commit. The vulnerability impacted
+two parts of the code, however one part, which deals with HRD parameters
+was only introduced in a later version (1.0.8), and is not present in
+the Kirkstone version yet (1.0.5).
+
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ libde265/sps.cc | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/libde265/sps.cc b/libde265/sps.cc
+index 476cdbb..37bde7b 100644
+--- a/libde265/sps.cc
++++ b/libde265/sps.cc
+@@ -425,7 +425,10 @@ de265_error seq_parameter_set::read(error_queue* errqueue, bitreader* br)
+ 
+   vui_parameters_present_flag = get_bits(br,1);
+   if (vui_parameters_present_flag) {
+-    vui.read(errqueue, br, this);
++    de265_error err = vui.read(errqueue, br, this);
++    if (err) {
++      return err;
++    }
+   }
+ 
+ 
meta-multimedia/recipes-multimedia/libde265/libde265_1.0.5.bb +3 -1
index d0ecd04f16..a9d5523bb5 100644
@@ -8,7 +8,9 @@ LICENSE = "LGPL-3.0-only & MIT"
 LICENSE_FLAGS = "commercial"
 LIC_FILES_CHKSUM = "file://COPYING;md5=695b556799abb2435c97a113cdca512f"
 
-SRC_URI = "https://github.com/strukturag/libde265/releases/download/v${PV}/${BPN}-${PV}.tar.gz"
+SRC_URI = "https://github.com/strukturag/libde265/releases/download/v${PV}/${BPN}-${PV}.tar.gz \
+           file://CVE-2022-1253.patch \
+           "
 SRC_URI[sha256sum] = "e3f277d8903408615a5cc34718b391b83c97c646faea4f41da93bac5ee08a87f"
 
 EXTRA_OECONF = "--disable-sherlock265 --disable-dec265"
#1 lore raw

PATCH 2/14 cockpit: set correct CVE_PRODUCT

(cherry picked from commit af4df551eec582844a8b56154117915ace1596cd)
---
 meta-webserver/recipes-webadmin/cockpit/cockpit_220.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-webserver/recipes-webadmin/cockpit/cockpit_220.bb +2 -0
index c08de89316..6f9005d59b 100644
@@ -189,3 +189,5 @@ do_install:append() {
         done
     fi
 }
+
+CVE_PRODUCT = "cockpit-project:cockpit"
#2 lore raw

PATCH 3/14 libao: ignore CVE-2017-11548

In reply to Gyorgy Sarvari

Both Suse[1] and Debian[2] disputes that this is a vulnerability in libao. Based on their investigation while an issue exists, it is not in libao, however higher in the audio-toolchain, most likely in libmad or mpg321. There seem to be nothing to be fixed about this in libao - ignore this CVE due to this.

[1]: https://bugzilla.suse.com/show_bug.cgi?id=1081767
[2]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=870608

(cherry picked from commit a993eb8b93f16e3a16c9a1ab2eb0939cb2331593)

Reworked for Kirkstone (CVE_STATUS -> CVE_CHECK_IGNORE)

---
 meta-multimedia/recipes-multimedia/libao/libao_1.2.0.bb | 3 +++
 1 file changed, 3 insertions(+)
meta-multimedia/recipes-multimedia/libao/libao_1.2.0.bb +3 -0
index b30f398e87..0a424d622a 100644
@@ -31,3 +31,6 @@ PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'alsa pulseaudio', d)}"
 PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib"
 PACKAGECONFIG[pulseaudio] = "--enable-pulse,--disable-pulse,pulseaudio"
 FILES:${BPN}-ckport = "${libdir}/ckport"
+
+# disputed: the referenced vulnerability is not in libao
+CVE_CHECK_IGNORE += "CVE-2017-11548"
#3 lore raw

PATCH 4/14 tigervnc: ignore CVE-2014-8241

In reply to Gyorgy Sarvari

Details: https://nvd.nist.gov/vuln/detail/CVE-2014-8241

The vulnerability is about a potential null-pointer dereference, because of a malloc result is not verified[1].

The vulnerable code has been refactored since completely[2], and the code isn't present anymore in the codebase.

[1]: https://github.com/TigerVNC/tigervnc/issues/993#issuecomment-612874972 - attachment [2]: https://github.com/TigerVNC/tigervnc/commit/b8a24f055f1a29886d8b18bb3f0902144dc5bd14

---
 meta-oe/recipes-graphics/tigervnc/tigervnc_1.11.0.bb | 3 +++
 1 file changed, 3 insertions(+)
meta-oe/recipes-graphics/tigervnc/tigervnc_1.11.0.bb +3 -0
index 5cde7c9fb4..699c0ed74f 100644
@@ -131,3 +131,6 @@ FILES:${PN} += " \
 "
 
 FILES:${PN}-dbg += "${libdir}/xorg/modules/extensions/.debug"
+
+# fixed-version: The vulnerable code is not present in the used version (1.11.0)
+CVE_CHECK_IGNORE += "CVE-2014-8241"
#4 lore raw

PATCH 5/14 libraw: ignore CVE-2020-35530

In reply to Gyorgy Sarvari

Details: https://nvd.nist.gov/vuln/detail/CVE-2020-35530

The fix is already included in the currently used revision.

---
 meta-oe/recipes-support/libraw/libraw_0.20.2.bb | 3 +++
 1 file changed, 3 insertions(+)
meta-oe/recipes-support/libraw/libraw_0.20.2.bb +3 -0
index 1940864a20..d842501ab4 100644
@@ -9,3 +9,6 @@ S = "${WORKDIR}/git"
 inherit autotools pkgconfig
 
 DEPENDS = "jpeg jasper lcms"
+
+# The fix is already included in the current versin (0.20.2)
+CVE_CHECK_IGNORE += "CVE-2020-35530"
#5 lore raw

PATCH 6/14 libraw: ignore CVE-2020-35531

In reply to Gyorgy Sarvari

Details: https://nvd.nist.gov/vuln/detail/CVE-2020-35531

The fix is already included in the currently used revision.

---
 meta-oe/recipes-support/libraw/libraw_0.20.2.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-oe/recipes-support/libraw/libraw_0.20.2.bb +2 -2
index d842501ab4..d87c78f46b 100644
@@ -10,5 +10,5 @@ inherit autotools pkgconfig
 
 DEPENDS = "jpeg jasper lcms"
 
-# The fix is already included in the current versin (0.20.2)
-CVE_CHECK_IGNORE += "CVE-2020-35530"
+# The fixes are already included in the current versin (0.20.2)
+CVE_CHECK_IGNORE += "CVE-2020-35530 CVE-2020-35531"
#6 lore raw

PATCH 7/14 libraw: ignore CVE-2020-35532

In reply to Gyorgy Sarvari

Details: https://nvd.nist.gov/vuln/detail/CVE-2020-35532

The fix is already included in the currently used revision.

---
 meta-oe/recipes-support/libraw/libraw_0.20.2.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/recipes-support/libraw/libraw_0.20.2.bb +1 -1
index d87c78f46b..ee64c33d78 100644
@@ -11,4 +11,4 @@ inherit autotools pkgconfig
 DEPENDS = "jpeg jasper lcms"
 
 # The fixes are already included in the current versin (0.20.2)
-CVE_CHECK_IGNORE += "CVE-2020-35530 CVE-2020-35531"
+CVE_CHECK_IGNORE += "CVE-2020-35530 CVE-2020-35531 CVE-2020-35532"
#7 lore raw

PATCH 8/14 libraw: ignore CVE-2020-35533

In reply to Gyorgy Sarvari

Details: https://nvd.nist.gov/vuln/detail/CVE-2020-35533

The fix is already included in the currently used revision.

---
 meta-oe/recipes-support/libraw/libraw_0.20.2.bb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
meta-oe/recipes-support/libraw/libraw_0.20.2.bb +6 -1
index ee64c33d78..41aac581f1 100644
@@ -11,4 +11,9 @@ inherit autotools pkgconfig
 DEPENDS = "jpeg jasper lcms"
 
 # The fixes are already included in the current versin (0.20.2)
-CVE_CHECK_IGNORE += "CVE-2020-35530 CVE-2020-35531 CVE-2020-35532"
+CVE_CHECK_IGNORE += " \
+    CVE-2020-35530 \
+    CVE-2020-35531 \
+    CVE-2020-35532 \
+    CVE-2020-35533 \
+    "
#8 lore raw

PATCH 9/14 libraw: ignore CVE-2020-35534

In reply to Gyorgy Sarvari

Details: https://nvd.nist.gov/vuln/detail/CVE-2020-35534

The fix is already included in the currently used revision.

---
 meta-oe/recipes-support/libraw/libraw_0.20.2.bb | 1 +
 1 file changed, 1 insertion(+)
meta-oe/recipes-support/libraw/libraw_0.20.2.bb +1 -0
index 41aac581f1..c7e83c05f5 100644
@@ -16,4 +16,5 @@ CVE_CHECK_IGNORE += " \
     CVE-2020-35531 \
     CVE-2020-35532 \
     CVE-2020-35533 \
+    CVE-2020-35534 \
     "
#9 lore raw

PATCH 10/14 libraw: ignore CVE-2020-35535

In reply to Gyorgy Sarvari

Details: https://nvd.nist.gov/vuln/detail/CVE-2020-35535

The fix is already included in the used revision.

---
 meta-oe/recipes-support/libraw/libraw_0.20.2.bb | 1 +
 1 file changed, 1 insertion(+)
meta-oe/recipes-support/libraw/libraw_0.20.2.bb +1 -0
index c7e83c05f5..51057f97b7 100644
@@ -17,4 +17,5 @@ CVE_CHECK_IGNORE += " \
     CVE-2020-35532 \
     CVE-2020-35533 \
     CVE-2020-35534 \
+    CVE-2020-35535 \
     "
#10 lore raw

PATCH 11/14 libraw: patch CVE-2023-1729

In reply to Gyorgy Sarvari

Details: https://nvd.nist.gov/vuln/detail/CVE-2023-1729

Pick the patch that is mentioned to solve the issue in the issue linked from the nvd report.

---
 .../libraw/libraw/CVE-2023-1729.patch         | 25 +++++++++++++++++++
 .../recipes-support/libraw/libraw_0.20.2.bb   |  4 ++-
 2 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-support/libraw/libraw/CVE-2023-1729.patch
meta-oe/recipes-support/libraw/libraw/CVE-2023-1729.patch new file +25 -0
new file mode 100644
index 0000000000..db6f2a2d9a
@@ -0,0 +1,25 @@
+From f7a1082a65b444d606d82ae71e1279789601f78d Mon Sep 17 00:00:00 2001
+From: Alex Tutubalin <[email protected]>
+Date: Sat, 14 Jan 2023 18:32:59 +0300
+Subject: [PATCH] do not set shrink flag for 3/4 component images
+
+CVE: CVE-2023-1729
+Upstream-Status: Backport [https://github.com/LibRaw/LibRaw/commit/9ab70f6dca19229cb5caad7cc31af4e7501bac93]
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ src/preprocessing/raw2image.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/preprocessing/raw2image.cpp b/src/preprocessing/raw2image.cpp
+index 18f897eb..64722efd 100644
+--- a/src/preprocessing/raw2image.cpp
++++ b/src/preprocessing/raw2image.cpp
+@@ -43,6 +43,8 @@ void LibRaw::raw2image_start()
+ 
+   // adjust for half mode!
+   IO.shrink =
++	  !imgdata.rawdata.color4_image && !imgdata.rawdata.color3_image &&
++	  !imgdata.rawdata.float4_image && !imgdata.rawdata.float3_image &&
+       P1.filters &&
+       (O.half_size || ((O.threshold || O.aber[0] != 1 || O.aber[2] != 1)));
+ 
meta-oe/recipes-support/libraw/libraw_0.20.2.bb +3 -1
index 51057f97b7..b331d77e8d 100644
@@ -2,7 +2,9 @@ SUMMARY = "raw image decoder"
 LICENSE = "LGPL-2.1-only | CDDL-1.0"
 LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=74c9dffdc42805f9c0de2f97df6031fc"
 
-SRC_URI = "git://github.com/LibRaw/LibRaw.git;branch=master;protocol=https"
+SRC_URI = "git://github.com/LibRaw/LibRaw.git;branch=master;protocol=https \
+           file://CVE-2023-1729.patch \
+           "
 SRCREV = "0209b6a2caec189e6d1a9b21c10e9e49f46e5a92"
 S = "${WORKDIR}/git"
 
#11 lore raw

PATCH 12/14 libraw: patch CVE-2025-43961 and CVE-2025-43962

In reply to Gyorgy Sarvari

Details: https://nvd.nist.gov/vuln/detail/CVE-2025-43961
https://nvd.nist.gov/vuln/detail/CVE-2025-43962

Pick the patch that is mentioned by the nvd reports - the same patch fixes both vulnerabilities.

---
 .../libraw/libraw/CVE-2025-43961-43962.patch  | 104 ++++++++++++++++++
 .../recipes-support/libraw/libraw_0.20.2.bb   |   1 +
 2 files changed, 105 insertions(+)
 create mode 100644 meta-oe/recipes-support/libraw/libraw/CVE-2025-43961-43962.patch
meta-oe/recipes-support/libraw/libraw/CVE-2025-43961-43962.patch new file +104 -0
new file mode 100644
index 0000000000..236bdfd621
@@ -0,0 +1,104 @@
+From f6587920471337158c058539c8e0353cbe0925d3 Mon Sep 17 00:00:00 2001
+From: Alex Tutubalin <[email protected]>
+Date: Sat, 1 Feb 2025 15:32:39 +0300
+Subject: [PATCH] Prevent out-of-bounds read in fuji 0xf00c tag parser
+
+Prevent out-of-bounds read in fuji 0xf00c tag parser
+
+prevent OOB reads in phase_one_correct
+
+CVE: CVE-2025-43961 CVE-2025-43962
+Upstream-Status: Backport [https://github.com/LibRaw/LibRaw/commit/66fe663e02a4dd610b4e832f5d9af326709336c2]
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ src/decoders/load_mfbacks.cpp | 18 ++++++++++++++----
+ src/metadata/tiff.cpp         | 22 ++++++++++++++--------
+ 2 files changed, 28 insertions(+), 12 deletions(-)
+
+diff --git a/src/decoders/load_mfbacks.cpp b/src/decoders/load_mfbacks.cpp
+index 9d7c0511..2def6d6e 100644
+--- a/src/decoders/load_mfbacks.cpp
++++ b/src/decoders/load_mfbacks.cpp
+@@ -331,6 +331,9 @@ int LibRaw::phase_one_correct()
+       fseek(ifp, off_412, SEEK_SET);
+       for (i = 0; i < 9; i++)
+         head[i] = get4() & 0x7fff;
++      unsigned w0 = head[1] * head[3], w1 = head[2] * head[4];
++      if (w0 > 10240000 || w1 > 10240000)
++        throw LIBRAW_EXCEPTION_ALLOC;
+       yval[0] = (float *)calloc(head[1] * head[3] + head[2] * head[4], 6);
+       merror(yval[0], "phase_one_correct()");
+       yval[1] = (float *)(yval[0] + head[1] * head[3]);
+@@ -356,10 +359,17 @@ int LibRaw::phase_one_correct()
+             for (k = j = 0; j < head[1]; j++)
+               if (num < xval[0][k = head[1] * i + j])
+                 break;
+-            frac = (j == 0 || j == head[1])
+-                       ? 0
+-                       : (xval[0][k] - num) / (xval[0][k] - xval[0][k - 1]);
+-            mult[i - cip] = yval[0][k - 1] * frac + yval[0][k] * (1 - frac);
++              if (j == 0 || j == head[1] || k < 1 || k >= w0+w1)
++                frac = 0;
++              else
++              {
++                int xdiv = (xval[0][k] - xval[0][k - 1]);
++                frac = xdiv ? (xval[0][k] - num) / (xval[0][k] - xval[0][k - 1]) : 0;
++              }
++              if (k < w0 + w1)
++                mult[i - cip] = yval[0][k > 0 ? k - 1 : 0] * frac + yval[0][k] * (1 - frac);
++              else
++                mult[i - cip] = 0;
+           }
+           i = ((mult[0] * (1 - cfrac) + mult[1] * cfrac) * row + num) * 2;
+           RAW(row, col) = LIM(i, 0, 65535);
+diff --git a/src/metadata/tiff.cpp b/src/metadata/tiff.cpp
+index cd2406d6..804ffa9c 100644
+--- a/src/metadata/tiff.cpp
++++ b/src/metadata/tiff.cpp
+@@ -980,17 +980,20 @@ int LibRaw::parse_tiff_ifd(int base)
+               if ((fwb[0] == rafdata[fi]) && (fwb[1] == rafdata[fi + 1]) &&
+                   (fwb[2] == rafdata[fi + 2]))
+               {
+-                if (rafdata[fi - 15] !=
++                if (fi > 14 && rafdata[fi - 15] !=
+                     fwb[0]) // 15 is offset of Tungsten WB from the first
+                             // preset, Fine Weather WB
+                   continue;
+-                for (int wb_ind = 0, ofst = fi - 15; wb_ind < Fuji_wb_list1.size();
+-                     wb_ind++, ofst += 3)
++                if (fi >= 15)
+                 {
+-                  icWBC[Fuji_wb_list1[wb_ind]][1] =
+-                      icWBC[Fuji_wb_list1[wb_ind]][3] = rafdata[ofst];
+-                  icWBC[Fuji_wb_list1[wb_ind]][0] = rafdata[ofst + 1];
+-                  icWBC[Fuji_wb_list1[wb_ind]][2] = rafdata[ofst + 2];
++                  for (int wb_ind = 0, ofst = fi - 15; wb_ind < (int)Fuji_wb_list1.size();
++                       wb_ind++, ofst += 3)
++                  {
++                    icWBC[Fuji_wb_list1[wb_ind]][1] =
++                          icWBC[Fuji_wb_list1[wb_ind]][3] = rafdata[ofst];
++                    icWBC[Fuji_wb_list1[wb_ind]][0] = rafdata[ofst + 1];
++                    icWBC[Fuji_wb_list1[wb_ind]][2] = rafdata[ofst + 2];
++                  }
+                 }
+ 
+                 if ((imFuji.RAFDataVersion == 0x0260) || // X-Pro3
+@@ -1000,6 +1003,8 @@ int LibRaw::parse_tiff_ifd(int base)
+                 fi += 96;
+                 for (fj = fi; fj < (fi + 15); fj += 3)
+                 {
++                  if (fj > libraw_internal_data.unpacker_data.lenRAFData - 3)
++                    break;
+                   if (rafdata[fj] != rafdata[fi])
+                   {
+                     fj -= 93;
+@@ -1009,7 +1014,8 @@ int LibRaw::parse_tiff_ifd(int base)
+                         (imFuji.RAFDataVersion == 0x0261) || // X100V
+                         (imFuji.RAFDataVersion == 0x0262))   // X-T4
+                       fj -= 9;
+-                    for (int iCCT = 0, ofst = fj; iCCT < 31;
++                    for (int iCCT = 0, ofst = fj; iCCT < 31
++                                                  && ofst < libraw_internal_data.unpacker_data.lenRAFData - 3;
+                          iCCT++, ofst += 3)
+                     {
+                       icWBCCTC[iCCT][0] = FujiCCT_K[iCCT];
meta-oe/recipes-support/libraw/libraw_0.20.2.bb +1 -0
index b331d77e8d..2e4ee20633 100644
@@ -4,6 +4,7 @@ LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=74c9dffdc42805f9c0de2f97df6031fc"
 
 SRC_URI = "git://github.com/LibRaw/LibRaw.git;branch=master;protocol=https \
            file://CVE-2023-1729.patch \
+           file://CVE-2025-43961-43962.patch \
            "
 SRCREV = "0209b6a2caec189e6d1a9b21c10e9e49f46e5a92"
 S = "${WORKDIR}/git"
#12 lore raw

PATCH 13/14 libraw: patch CVE-2025-43963

In reply to Gyorgy Sarvari

Details: https://nvd.nist.gov/vuln/detail/CVE-2025-43963

Pick the patch that is referenced in the nvd report.

---
 .../libraw/libraw/CVE-2025-43963.patch        | 36 +++++++++++++++++++
 .../recipes-support/libraw/libraw_0.20.2.bb   |  1 +
 2 files changed, 37 insertions(+)
 create mode 100644 meta-oe/recipes-support/libraw/libraw/CVE-2025-43963.patch
meta-oe/recipes-support/libraw/libraw/CVE-2025-43963.patch new file +36 -0
new file mode 100644
index 0000000000..9e594dd110
@@ -0,0 +1,36 @@
+From 188a8ba8e1e0a7a85d04dafd867a1a069b568ed9 Mon Sep 17 00:00:00 2001
+From: Alex Tutubalin <[email protected]>
+Date: Thu, 6 Feb 2025 21:01:58 +0300
+Subject: [PATCH] check split_col/split_row values in phase_one_correct
+
+CVE: CVE-2025-43963
+Upstream-Status: Backport [https://github.com/LibRaw/LibRaw/commit/be26e7639ecf8beb55f124ce780e99842de2e964]
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ src/decoders/load_mfbacks.cpp | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/decoders/load_mfbacks.cpp b/src/decoders/load_mfbacks.cpp
+index 2def6d6e..00a9bc1e 100644
+--- a/src/decoders/load_mfbacks.cpp
++++ b/src/decoders/load_mfbacks.cpp
+@@ -211,7 +211,8 @@ int LibRaw::phase_one_correct()
+           off_412 = ftell(ifp) - 38;
+         }
+       }
+-      else if (tag == 0x041f && !qlin_applied)
++      else if (tag == 0x041f && !qlin_applied && ph1.split_col > 0 && ph1.split_col < raw_width
++               && ph1.split_row > 0 && ph1.split_row < raw_height)
+       { /* Quadrant linearization */
+         ushort lc[2][2][16], ref[16];
+         int qr, qc;
+@@ -288,7 +289,8 @@ int LibRaw::phase_one_correct()
+         }
+         qmult_applied = 1;
+       }
+-      else if (tag == 0x0431 && !qmult_applied)
++      else if (tag == 0x0431 && !qmult_applied && ph1.split_col > 0 && ph1.split_col < raw_width
++               && ph1.split_row > 0 && ph1.split_row < raw_height)
+       { /* Quadrant combined */
+         ushort lc[2][2][7], ref[7];
+         int qr, qc;
meta-oe/recipes-support/libraw/libraw_0.20.2.bb +1 -0
index 2e4ee20633..8d82d3a49c 100644
@@ -5,6 +5,7 @@ LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=74c9dffdc42805f9c0de2f97df6031fc"
 SRC_URI = "git://github.com/LibRaw/LibRaw.git;branch=master;protocol=https \
            file://CVE-2023-1729.patch \
            file://CVE-2025-43961-43962.patch \
+           file://CVE-2025-43963.patch \
            "
 SRCREV = "0209b6a2caec189e6d1a9b21c10e9e49f46e5a92"
 S = "${WORKDIR}/git"
#13 lore raw

PATCH 14/14 libraw: patch CVE-2025-43964

In reply to Gyorgy Sarvari

Details: https://nvd.nist.gov/vuln/detail/CVE-2025-43964

Pick the patch that is referenced by the nvd report.

---
 .../libraw/libraw/CVE-2025-43964.patch        | 25 +++++++++++++++++++
 .../recipes-support/libraw/libraw_0.20.2.bb   |  1 +
 2 files changed, 26 insertions(+)
 create mode 100644 meta-oe/recipes-support/libraw/libraw/CVE-2025-43964.patch
meta-oe/recipes-support/libraw/libraw/CVE-2025-43964.patch new file +25 -0
new file mode 100644
index 0000000000..592c2d5ea1
@@ -0,0 +1,25 @@
+From 0e068c2826ca6a70973ec2a75d05bc95b11e4977 Mon Sep 17 00:00:00 2001
+From: Alex Tutubalin <[email protected]>
+Date: Sun, 2 Mar 2025 11:35:43 +0300
+Subject: [PATCH] additional checks in PhaseOne correction tag 0x412 processing
+
+CVE: CVE-2025-43964
+Upstream-Status: Backport [https://github.com/LibRaw/LibRaw/commit/a50dc3f1127d2e37a9b39f57ad9bb2ebb60f18c0]
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ src/decoders/load_mfbacks.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/decoders/load_mfbacks.cpp b/src/decoders/load_mfbacks.cpp
+index 00a9bc1e..8ba791c6 100644
+--- a/src/decoders/load_mfbacks.cpp
++++ b/src/decoders/load_mfbacks.cpp
+@@ -336,6 +336,8 @@ int LibRaw::phase_one_correct()
+       unsigned w0 = head[1] * head[3], w1 = head[2] * head[4];
+       if (w0 > 10240000 || w1 > 10240000)
+         throw LIBRAW_EXCEPTION_ALLOC;
++      if (w0 < 1 || w1 < 1)
++         throw LIBRAW_EXCEPTION_IO_CORRUPT;
+       yval[0] = (float *)calloc(head[1] * head[3] + head[2] * head[4], 6);
+       merror(yval[0], "phase_one_correct()");
+       yval[1] = (float *)(yval[0] + head[1] * head[3]);
meta-oe/recipes-support/libraw/libraw_0.20.2.bb +1 -0
index 8d82d3a49c..3ac2d3e795 100644
@@ -6,6 +6,7 @@ SRC_URI = "git://github.com/LibRaw/LibRaw.git;branch=master;protocol=https \
            file://CVE-2023-1729.patch \
            file://CVE-2025-43961-43962.patch \
            file://CVE-2025-43963.patch \
+           file://CVE-2025-43964.patch \
            "
 SRCREV = "0209b6a2caec189e6d1a9b21c10e9e49f46e5a92"
 S = "${WORKDIR}/git"