You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2023/06/15 03:52:00 UTC
svn commit: r1910413 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java
Author: tilman
Date: Thu Jun 15 03:52:00 2023
New Revision: 1910413
URL: http://svn.apache.org/viewvc?rev=1910413&view=rev
Log:
PDFBOX-5621: avoid NPE if the softmask has text
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java
Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java?rev=1910413&r1=1910412&r2=1910413&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java Thu Jun 15 03:52:00 2023
@@ -199,8 +199,22 @@ public abstract class PDFStreamEngine
saveGraphicsState();
Matrix softMaskCTM = getGraphicsState().getSoftMask().getInitialTransformationMatrix();
getGraphicsState().setCurrentTransformationMatrix(softMaskCTM);
- processTransparencyGroup(group);
- restoreGraphicsState();
+
+ // PDFBOX-5621: save text matrices (softmasks may contain BT/ET)
+ Matrix textMatrixOld = textMatrix;
+ textMatrix = new Matrix();
+ Matrix textLineMatrixOld = textLineMatrix;
+ textLineMatrix = new Matrix();
+ try
+ {
+ processTransparencyGroup(group);
+ }
+ finally
+ {
+ textMatrix = textMatrixOld;
+ textLineMatrix = textLineMatrixOld;
+ restoreGraphicsState();
+ }
}
/**