Fix for TALOS-2026-2331
authorAlex Tutubalin <lexa@lexa.ru>
Sat, 28 Feb 2026 15:26:53 +0000 (18:26 +0300)
committerGuilhem Moulin <guilhem@debian.org>
Wed, 29 Jul 2026 01:53:35 +0000 (03:53 +0200)
Origin: https://github.com/LibRaw/LibRaw/commit/75ed2c12a35b765b3b6ad695cc1f044f19efe644
Bug: https://talosintelligence.com/vulnerability_reports/TALOS-2026-2331
Bug-Debian: https://bugs.debian.org/1133845
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2026-21413

Gbp-Pq: Name CVE-2026-21413.patch

src/decoders/decoders_dcraw.cpp

index 183136b6cce47e07596fc23ae235c5306230a140..fc73e6c20a949e585e58850bece92878519134d5 100644 (file)
@@ -560,6 +560,7 @@ void LibRaw::lossless_jpeg_load_raw()
   if (jh.clrs == 4 && jwide >= raw_width * 2)
     jhigh *= 2;
 
+  
   try
   {
     for (jrow = 0; jrow < jh.high; jrow++)
@@ -588,7 +589,7 @@ void LibRaw::lossless_jpeg_load_raw()
           col += (row--, raw_width);
         if (row > raw_height)
           throw LIBRAW_EXCEPTION_IO_CORRUPT;
-        if ((unsigned)row < raw_height)
+        if (((unsigned)row < raw_height) && ((unsigned)col < raw_width))
           RAW(row, col) = val;
         if (++col >= raw_width)
           col = (row++, 0);