goo/GooString.cc | 2 +- goo/GooString.h | 3 ++- poppler/PDFDoc.cc | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-)
New commits: commit 269a91e3b03a19acc06fd0f72356f2e48a6368a7 Author: Jakub Alba <[email protected]> Date: Tue Aug 23 13:20:44 2016 +0200 PDFDoc::setDocInfoStringEntry(): treat value consisting of just the unicode marker as an empty string diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc index f81fa75..587b2be 100644 --- a/poppler/PDFDoc.cc +++ b/poppler/PDFDoc.cc @@ -615,7 +615,7 @@ void PDFDoc::setDocInfoModified(Object *infoObj) void PDFDoc::setDocInfoStringEntry(const char *key, GooString *value) { - GBool removeEntry = !value || value->getLength() == 0; + GBool removeEntry = !value || value->getLength() == 0 || value->hasJustUnicodeMarker(); if (removeEntry) { delete value; } commit 43cfdf9de45e6833a2815b173f8cc945f1c5f9d6 Author: Jakub Alba <[email protected]> Date: Tue Aug 23 13:19:07 2016 +0200 goo: add GooString::hasJustUnicodeMarker(void) diff --git a/goo/GooString.cc b/goo/GooString.cc index 7c8913f..12592e4 100644 --- a/goo/GooString.cc +++ b/goo/GooString.cc @@ -912,7 +912,7 @@ GBool GooString::endsWith(const char *suffix) const { return strcmp(s + length - suffixLen, suffix) == 0; } -GBool GooString::hasUnicodeMarker(void) +GBool GooString::hasUnicodeMarker(void) const { return length > 1 && (s[0] & 0xff) == 0xfe && (s[1] & 0xff) == 0xff; } diff --git a/goo/GooString.h b/goo/GooString.h index f62838d..de70497 100644 --- a/goo/GooString.h +++ b/goo/GooString.h @@ -160,7 +160,8 @@ public: // Return true if string ends with suffix GBool endsWith(const char *suffix) const; - GBool hasUnicodeMarker(void); + GBool hasUnicodeMarker(void) const; + GBool hasJustUnicodeMarker(void) const { return length == 2 && hasUnicodeMarker(); } // Sanitizes the string so that it does // not contain any ( ) < > [ ] { } / % _______________________________________________ poppler mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/poppler
