summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/libtiff/tiff/CVE-2025-8177_1.patch
blob: 9437ffcc2086dea1aaedaecb9cede1696fe907bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 01bf5ba7f4a27c5e28ce467a66b13e066556e545 Mon Sep 17 00:00:00 2001
From: Lee Howard <faxguy@howardsilvan.com>
Date: Thu, 19 Jun 2025 11:51:33 -0700
Subject: [PATCH 6/7] Fix for thumbnail issue #715

CVE: CVE-2025-8177
Upstream-Status: Backport from [https://gitlab.com/libtiff/libtiff/-/commit/75d8eca6f106c01aadf76b8500a7d062b12f2d82]
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
---
 tools/thumbnail.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tools/thumbnail.c b/tools/thumbnail.c
index b4cb114..432d172 100644
--- a/tools/thumbnail.c
+++ b/tools/thumbnail.c
@@ -620,7 +620,15 @@ static void setrow(uint8_t *row, uint32_t nrows, const uint8_t *rows[])
             }
             acc += bits[*src & mask1];
         }
-        *row++ = cmap[(255 * acc) / area];
+        if (255 * acc / area < 256)
+        {
+            *row++ = cmap[(255 * acc) / area];
+        }
+        else
+        {
+            fprintf(stderr, "acc=%d, area=%d\n", acc, area);
+            row++;
+        }
     }
 }
 
-- 
2.47.3