summaryrefslogtreecommitdiffstats
path: root/heap-buffer-overflow.patch
blob: 6dcd51a6418c91af45daea4b7d706751d89abad7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff -rupN --no-dereference openjpeg-2.4.0/src/bin/common/color.c openjpeg-2.4.0-new/src/bin/common/color.c
--- openjpeg-2.4.0/src/bin/common/color.c	2020-12-28 21:59:39.000000000 +0100
+++ openjpeg-2.4.0-new/src/bin/common/color.c	2021-05-27 23:46:46.961130438 +0200
@@ -368,12 +368,15 @@ static void sycc420_to_rgb(opj_image_t *
 
             sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
 
-            ++y;
+            if (*y != img->comps[0].data[loopmaxh])
+                ++y;
             ++r;
             ++g;
             ++b;
-            ++cb;
-            ++cr;
+            if (*cb != img->comps[1].data[loopmaxh])
+                ++cb;
+            if (*cr != img->comps[2].data[loopmaxh])
+                ++cr;
         }
         if (j < maxw) {
             sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);