new file mode 100644
@@ -0,0 +1,40 @@
+From 975393c804bc321fd4bc709c3c221733dac2d80a Mon Sep 17 00:00:00 2001
+From: Alex Tutubalin <lexa@lexa.ru>
+Date: Thu, 6 Feb 2025 21:01:58 +0300
+Subject: [PATCH] CVE-2025-43963
+
+check split_col/split_row values in phase_one_correct
+
+CVE: CVE-2025-43963
+Upstream-Status: Backport [https://github.com/LibRaw/LibRaw/commit/be26e7639ecf8beb55f124ce780e99842de2e964]
+
+(cherry picked from commit be26e7639ecf8beb55f124ce780e99842de2e964)
+Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
+---
+ 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 1a1bdfb3..f89aecce 100644
+--- a/src/decoders/load_mfbacks.cpp
++++ b/src/decoders/load_mfbacks.cpp
+@@ -348,7 +348,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;
+@@ -432,7 +433,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 - four tile gain calibration */
+ ushort lc[2][2][7], ref[7];
+ int qr, qc;
@@ -5,6 +5,7 @@ LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=1501ae0aa3c8544e63f08d6f7bf88a6f"
SRC_URI = " \
git://github.com/LibRaw/LibRaw.git;branch=0.21-stable;protocol=https \
file://0001-CVE-2025-43961-CVE-2025-43962.patch \
+ file://0002-CVE-2025-43963.patch \
"
SRCREV = "1ef70158d7fde1ced6aaddb0b9443c32a7121d3d"
S = "${WORKDIR}/git"