external/libtiff/libtiff.16bitcielab.patch |    6 +++---
 vcl/source/filter/itiff/itiff.cxx          |   16 ++++++++--------
 2 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 4bd3b725cba43c1c2cce2120008d017ac1ebef16
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon May 23 21:01:24 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue May 24 09:54:36 2022 +0200

    We actually want to divide by 257 here
    
    follow the * 257 suggestion at
    https://gitlab.com/libtiff/libtiff/-/merge_requests/336
    
    I did think it looked a tiny bit different than the others
    
    Change-Id: I92306ae22d2acc485a4162160a8c0464a32591d9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134844
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/external/libtiff/libtiff.16bitcielab.patch 
b/external/libtiff/libtiff.16bitcielab.patch
index cecce9cd8402..968de975f641 100644
--- a/external/libtiff/libtiff.16bitcielab.patch
+++ b/external/libtiff/libtiff.16bitcielab.patch
@@ -34,9 +34,9 @@
 +      for( ; h > 0; --h) {
 +              for (x = w; x > 0; --x) {
 +                      TIFFCIELabToXYZ(img->cielab,
-+                                      wp[0] / 256,
-+                                      wp[1] / 256,
-+                                      wp[2] / 256,
++                                      (uint16_t)wp[0] / 257,
++                                      (int16_t)wp[1] / 256,
++                                      (int16_t)wp[2] / 256,
 +                                      &X, &Y, &Z);
 +                      TIFFXYZToRGB(img->cielab, X, Y, Z, &r, &g, &b);
 +                      *cp++ = PACK(r, g, b);
commit c16652e1ecf0a8cfcd50f361c199ff7598282b9c
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon May 23 17:24:06 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue May 24 09:54:21 2022 +0200

    move the comment around a bit
    
    Change-Id: I784534285baa5e68f8d8877c6a5fe8c10e5eb429
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134843
    Tested-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/source/filter/itiff/itiff.cxx 
b/vcl/source/filter/itiff/itiff.cxx
index 9f51e28df0a9..4514ce916959 100644
--- a/vcl/source/filter/itiff/itiff.cxx
+++ b/vcl/source/filter/itiff/itiff.cxx
@@ -267,14 +267,14 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& 
rGraphic)
                 img.put.separate = putSeparatePixel;
             }
 
-            bOk = TIFFRGBAImageGet(
-                &img, reinterpret_cast<uint32_t *>(sizeof (uint32_t)), w, 
img.height);
-                // we don't access TIFFRGBAImageGet's raster argument in our 
custom putContigPixel/
-                // putSeparatePixel functions, but TIFFRGBAImageGet 
nevertheless internally
-                // advances that pointer, so passing nullptr would cause UBSan 
nullptr-with-offset
-                // errors; while technically still UB, this HACK of passing a 
non-null pointer keeps
-                // UBSan happy for now (and better use an artificial pointer 
value which would
-                // hopefully cause SIGSEGV if it should erroneously be 
dereferenced after all)
+            // we don't access TIFFRGBAImageGet's raster argument in our 
custom putContigPixel/
+            // putSeparatePixel functions, but TIFFRGBAImageGet nevertheless 
internally
+            // advances that pointer, so passing nullptr would cause UBSan 
nullptr-with-offset
+            // errors; while technically still UB, this HACK of passing a 
non-null pointer keeps
+            // UBSan happy for now (and better use an artificial pointer value 
which would
+            // hopefully cause SIGSEGV if it should erroneously be 
dereferenced after all)
+            uint32_t* unused_raster = reinterpret_cast<uint32_t *>(sizeof 
(uint32_t));
+            bOk = TIFFRGBAImageGet(&img, unused_raster, w, img.height);
             TIFFRGBAImageEnd(&img);
         }
         else

Reply via email to