poppler/JBIG2Stream.cc | 6 +++--- poppler/JBIG2Stream.h | 2 +- poppler/Stream.cc | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-)
New commits: commit f846c9a2ccdd975ead3b8287cbac0064841ef360 Author: Albert Astals Cid <[email protected]> Date: Wed Nov 14 15:26:47 2018 +0100 JBIG2Stream: Move Object instead of copying it diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc index f4c735e6..5eea3bf2 100644 --- a/poppler/JBIG2Stream.cc +++ b/poppler/JBIG2Stream.cc @@ -1174,7 +1174,7 @@ JBIG2CodeTable::~JBIG2CodeTable() { // JBIG2Stream //------------------------------------------------------------------------ -JBIG2Stream::JBIG2Stream(Stream *strA, Object *globalsStreamA, Object *globalsStreamRefA): +JBIG2Stream::JBIG2Stream(Stream *strA, Object &&globalsStreamA, Object *globalsStreamRefA): FilterStream(strA) { pageBitmap = nullptr; @@ -1199,8 +1199,8 @@ JBIG2Stream::JBIG2Stream(Stream *strA, Object *globalsStreamA, Object *globalsSt huffDecoder = new JBIG2HuffmanDecoder(); mmrDecoder = new JBIG2MMRDecoder(); - if (globalsStreamA->isStream()) { - globalsStream = globalsStreamA->copy(); + if (globalsStreamA.isStream()) { + globalsStream = std::move(globalsStreamA); if (globalsStreamRefA->isRef()) globalsStreamRef = globalsStreamRefA->getRef(); } diff --git a/poppler/JBIG2Stream.h b/poppler/JBIG2Stream.h index a4279553..1f6a02ab 100644 --- a/poppler/JBIG2Stream.h +++ b/poppler/JBIG2Stream.h @@ -43,7 +43,7 @@ class JBIG2MMRDecoder; class JBIG2Stream: public FilterStream { public: - JBIG2Stream(Stream *strA, Object *globalsStreamA, Object *globalsStreamRefA); + JBIG2Stream(Stream *strA, Object &&globalsStreamA, Object *globalsStreamRefA); ~JBIG2Stream(); StreamKind getKind() override { return strJBIG2; } void reset() override; diff --git a/poppler/Stream.cc b/poppler/Stream.cc index cc5e28dd..cc4eb935 100644 --- a/poppler/Stream.cc +++ b/poppler/Stream.cc @@ -213,7 +213,7 @@ Stream *Stream::makeFilter(const char *name, Stream *str, Object *params, int re int encoding; bool endOfLine, byteAlign, endOfBlock, black, damagedRowsBeforeError; int columns, rows; - Object globals, obj; + Object obj; if (!strcmp(name, "ASCIIHexDecode") || !strcmp(name, "AHx")) { str = new ASCIIHexStream(str); @@ -325,12 +325,13 @@ Stream *Stream::makeFilter(const char *name, Stream *str, Object *params, int re } str = new FlateStream(str, pred, columns, colors, bits); } else if (!strcmp(name, "JBIG2Decode")) { + Object globals; if (params->isDict()) { XRef *xref = params->getDict()->getXRef(); obj = params->dictLookupNF("JBIG2Globals"); globals = obj.fetch(xref, recursion); } - str = new JBIG2Stream(str, &globals, &obj); + str = new JBIG2Stream(str, std::move(globals), &obj); } else if (!strcmp(name, "JPXDecode")) { #ifdef HAVE_JPX_DECODER str = new JPXStream(str); _______________________________________________ poppler mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/poppler
