[Libreoffice-commits] core.git: external/poppler

Stephan Bergmann sbergman at redhat.com
Tue Mar 10 04:36:26 PDT 2015


 external/poppler/ubsan.patch.0 |   37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

New commits:
commit a788eea404b71ddca24eb13506fd51ea41485a69
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 10 12:35:37 2015 +0100

    external/poppler: Work around -fsanitize=shift
    
    Change-Id: I5d9734f302ff58637f69c1574bc39ca85ff992e7

diff --git a/external/poppler/ubsan.patch.0 b/external/poppler/ubsan.patch.0
index 2db8c5a..2b0b334 100644
--- a/external/poppler/ubsan.patch.0
+++ b/external/poppler/ubsan.patch.0
@@ -1,3 +1,40 @@
+--- poppler/Stream.cc
++++ poppler/Stream.cc
+@@ -2966,12 +2966,12 @@
+       } else {
+ 	amp = 0;
+       }
+-      data[0] += (*prevDC += amp) << scanInfo.al;
++      data[0] += (int) ((unsigned) (*prevDC += amp) << scanInfo.al);
+     } else {
+       if ((bit = readBit()) == 9999) {
+ 	return gFalse;
+       }
+-      data[0] += bit << scanInfo.al;
++      data[0] += (unsigned) bit << scanInfo.al;
+     }
+     ++i;
+   }
+@@ -3064,7 +3064,7 @@
+ 	  j = dctZigZag[i++];
+ 	}
+       }
+-      data[j] = amp << scanInfo.al;
++      data[j] = (unsigned) amp << scanInfo.al;
+     }
+   }
+ 
+@@ -3251,8 +3251,8 @@
+     v3 = p[6];
+     v4 = (dctSqrt1d2 * (p[1] - p[7]) + 128) >> 8;
+     v7 = (dctSqrt1d2 * (p[1] + p[7]) + 128) >> 8;
+-    v5 = p[3] << 4;
+-    v6 = p[5] << 4;
++    v5 = (unsigned) p[3] << 4;
++    v6 = (unsigned) p[5] << 4;
+ 
+     // stage 3
+     t = (v0 - v1+ 1) >> 1;
 --- poppler/XRef.cc
 +++ poppler/XRef.cc
 @@ -293,6 +293,7 @@


More information about the Libreoffice-commits mailing list