[poppler] poppler/TextOutputDev.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Sat Sep 3 07:19:40 UTC 2016


 poppler/TextOutputDev.cc |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit fea7bfc3978cb962e2372df3c407114effd5f831
Author: Jason Crain <jason at inspiresomeone.us>
Date:   Sat Jul 30 03:38:29 2016 -0500

    TextOutputDev: Remove null characters from PDF text
    
    Null characters in the PDF text cause problems with the glib frontend's
    handling of C strings.  Filter them out.
    
    Bug #97144

diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc
index cf39bd8..56ea3cc 100644
--- a/poppler/TextOutputDev.cc
+++ b/poppler/TextOutputDev.cc
@@ -2611,6 +2611,10 @@ void TextPage::addChar(GfxState *state, double x, double y,
     charPos += nBytes;
     endWord();
     return;
+  } else if (uLen == 1 && u[0] == (Unicode)0x0) {
+    // ignore null characters
+    charPos += nBytes;
+    return;
   }
 
   state->getFontTransMat(&mat.m[0], &mat.m[1], &mat.m[2], &mat.m[3]);


More information about the poppler mailing list