diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-11-05 03:03:37 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-11-05 03:03:37 +0000 |
commit | 564cd64dc5f2727c4df6aeb1bb51327503c84e78 (patch) | |
tree | 44f51d1887abfcdb7df61a570c2ffa0d6841d7db /media-gfx/inkscape | |
parent | 3cc82055be7dba177f4aea15af9f5414b532da7e (diff) |
gentoo auto-resync : 05:11:2024 - 03:03:37
Diffstat (limited to 'media-gfx/inkscape')
-rw-r--r-- | media-gfx/inkscape/Manifest | 3 | ||||
-rw-r--r-- | media-gfx/inkscape/files/inkscape-1.4-poppler-24.10-fix-backport.patch | 432 | ||||
-rw-r--r-- | media-gfx/inkscape/inkscape-1.4.ebuild | 1 |
3 files changed, 435 insertions, 1 deletions
diff --git a/media-gfx/inkscape/Manifest b/media-gfx/inkscape/Manifest index 92ed2587a306..2fa31ca23ff6 100644 --- a/media-gfx/inkscape/Manifest +++ b/media-gfx/inkscape/Manifest @@ -4,11 +4,12 @@ AUX inkscape-1.3.2-libxml2-2.12.patch 916 BLAKE2B 06ff8b562f6eb703ae2b88a8f0c4ce AUX inkscape-1.3.2-poppler-24.03.patch 2982 BLAKE2B b8ed08ef09afbab15196ae6d0f198acc01a4000bc2688d0209d53108dac0c801f9d3d1d3be78893e6268f0e82ca7f61b6975252d29aa657487fe792d42c79532 SHA512 9bd8062599fe183de837804106aa2501cb77710f76214663dfd504d9a7cb4a4bc838311c87ed2bbacca4bbcab29a2f81e0831cbd4f8c2017816a0e6fbbfe306b AUX inkscape-1.3.2-poppler-24.05.patch 2620 BLAKE2B 0fc615690c365cf1630b680f1b6c43d28667263e26c2dad7697e9f7ae56a91b05bf6457f99578ec2a8b771155349b5dbe125f00fcc28f148ba7d58c2887230a5 SHA512 8da5c3db83968a42e1e43b1dc7148724fe2b18299b8c6cf58ab8315566daaa8d2d5cc9030cdb9bc31b55cbd868410a314b7b097ae0f4bd5ccba99c073839e0dc AUX inkscape-1.4-gcc15.patch 1088 BLAKE2B 56e9e4e14d87d20d7a03e388105ccdaa219fc26146c771c2c6942ca82abee54fb43d0807ce0ddf59cc77ec6e5184db5e628980209f5eda651ac6ee09af96f74e SHA512 b6f18c645c9946a7052c2d93df1475f1d9db626f200754b767f4372c17e056389c93fc129385d1c9ed3f0e329866696adfb8a61f6e4bc4058c23f20324287072 +AUX inkscape-1.4-poppler-24.10-fix-backport.patch 19196 BLAKE2B 02f58958180e2362f1e11a1cbacd72611b37cdaa41abd922df6106ef5485f243ef105286a92727b5731a4d0f607846a3e0a48fa53e3b9542d3667f136fd07f9b SHA512 6283ccd63157bc8ccdcf6127afa72cb50a72a9f09ec2327a5f180f0eb2d212e5600ed0f3d31df845cf6d20c2fe84d01f1edb126f39456a27de36cca616495fb9 DIST inkscape-1.3.2.tar.xz 44720944 BLAKE2B 24120f8c671e1fb54bb6626cab95e7086e3c60fbc117bbe8017d081c799bc26812b1286e670771e7ffe88720ba25f237146c452afaf65c1ee2ee554fb07f79a2 SHA512 a6da4b676ba3e7f954f95e3916ce78ce358b49c8052795a52d478064ef02eeae0337b0a94e89b9752ea6824a5758d28072c2bbf83f1e9ee28daebd3b0ef87343 DIST inkscape-1.4.tar.xz 46321868 BLAKE2B 3f21402019995122f043f5ebd8f07e1c9548c507f27c494e4214e090c46acae016c21f950609c95cef2e1b0011693e6629326d733b257402391e2d919bcd0303 SHA512 3b81306b81416597073e7eda2a103112cee63493bcf96fa737bb1edfbd682ebb329e415bbbbfda877aef2a78dc376460040ebc5c0cc2c90c0fe60db5d7d12368 DIST inkscape-1.4beta3.tar.xz 46065140 BLAKE2B e24849462170014ee6ffd609e5f6db38694e387a5988929bc52cf3b9594d0021c63d8bdfe997dc22f6c544e1c65b9ccd78f314cb943242a860471122d32efcd8 SHA512 3c8d757eacef54742c4c8b9ce923719fee4ae1fb6d39031fecdf4d9641cfaa2e689adcfa16a7450a43aefe5795a2319f0ef5cd7304e78b2a9bff0da02106faba EBUILD inkscape-1.3.2-r2.ebuild 5874 BLAKE2B a95355ae1c5bd7806e05314ae07f9a3b278897c03e217dffa0433ee51e7fb0e0a47f06ead4c2f1ba47ee2e8bce49f4b378d31e3de6e9b64cac96cd0c1304a0eb SHA512 229a75fd98d6be7c25443a87bdb14b792a89cf30df55158945db2f2d7c7e247e5ce39e351c41e11324fbd6d9a31f0d669985455367c870adb951b358a3c7b4a1 -EBUILD inkscape-1.4.ebuild 5504 BLAKE2B d7bbfa3756cd9eb53910bd18290cfe344dd5b7a1b04d618982057c93b0a1207a20641084f31b3468a61951867358ee15b3f7e42b9aee40aae49064650b8498df SHA512 eca85a418bfd55597d8d3e0b841ec3ac58a5dc17bc417aa7595c2caa18557a198079b59ac8d8122ccfe7edf2c01e0e865bff032f31c8f5956621d438b6eb8ace +EBUILD inkscape-1.4.ebuild 5562 BLAKE2B 42c0b1b622d2ad1c2c25921693379c9863615c344e7f5d8ac49026dd030f606f6dff7bedeaa3774c0482cfa30a779b02e96b6d5ab6b1da1b588109f05c30f342 SHA512 921678f6be488dea5d2de172c505f5faf7600b76f35888c20b9dc386a1e0588acea6c8a431dfe28f8f26159f742d7a0776e722ba4e0b8f993b4fd13a7480fd7e EBUILD inkscape-1.4_beta3.ebuild 5454 BLAKE2B 9c0d873f35ae8af58329690852a05644a6a3696f1a3245ca3922c52dae0033ea9f02b8b54f0df091ad37a7f6ab77ab04d04d38a23d3cd8caad68b06b02814b17 SHA512 f93bf9f1f1b8bdc39d9a988aaf0d1cd1a583df14f909e927feb5781f531981b4eedb504d2f95491fe8120f63760ce9dafc45a46c705a2af675cb0824739efdb4 EBUILD inkscape-9999.ebuild 5454 BLAKE2B 11e8e32147c195970e30d294cb5622748260c5d5cc1f2b4fbde7c90206c481416226a56c6cd8edd31971923b93c5f76897a5ad9eecec6f5903e1b58f5c2e41f5 SHA512 36f9f68fbef97a896250ecff86717747eb4b7be7d5ab9e465a536dee62c58db2ba80bdb549719010811685634b3cf54540f443955894b1037754004b0dc6c079 MISC metadata.xml 982 BLAKE2B f44f534865614c8dd7bf71e92ce69cff708fc08e3eb701765bf93144b433ec52df52a506b69cc98969909c695015881b60592cccdf27613c6fe82812fc50727b SHA512 2963a9b473f139d06cefd1c3231ef148045c005adb4688850522c183f39ba15a36331b7eae7752e9bf15a26e6370f2af14ec02e59735f1753246c45821c0cdbc diff --git a/media-gfx/inkscape/files/inkscape-1.4-poppler-24.10-fix-backport.patch b/media-gfx/inkscape/files/inkscape-1.4-poppler-24.10-fix-backport.patch new file mode 100644 index 000000000000..c20ab13e4f52 --- /dev/null +++ b/media-gfx/inkscape/files/inkscape-1.4-poppler-24.10-fix-backport.patch @@ -0,0 +1,432 @@ +https://bugs.gentoo.org/941933 + +From 22304ae8034d067670a9f95022083a75fac92b4c Mon Sep 17 00:00:00 2001 +From: PBS <pbs3141@gmail.com> +Date: Tue, 22 Oct 2024 14:48:31 +0100 +Subject: [PATCH] Future-proof against poppler 24.10 changes + +--- + .../internal/pdfinput/pdf-parser.cpp | 120 ++++++++---------- + src/extension/internal/pdfinput/pdf-parser.h | 4 +- + .../pdfinput/poppler-transition-api.h | 6 + + 3 files changed, 61 insertions(+), 69 deletions(-) + +diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp +index 97b2909218a..28000a87b0c 100644 +--- a/src/extension/internal/pdfinput/pdf-parser.cpp ++++ b/src/extension/internal/pdfinput/pdf-parser.cpp +@@ -817,11 +817,11 @@ void PdfParser::opSetExtGState(Object args[], int /*numArgs*/) + _POPPLER_FREE(obj3); + if (_POPPLER_CALL_ARGS_DEREF(obj3, obj2.dictLookup, "G").isStream()) { + if (_POPPLER_CALL_ARGS_DEREF(obj4, obj3.streamGetDict()->lookup, "Group").isDict()) { +- GfxColorSpace *blendingColorSpace = nullptr; ++ std::unique_ptr<GfxColorSpace> blendingColorSpace; + GBool isolated = gFalse; + GBool knockout = gFalse; + if (!_POPPLER_CALL_ARGS_DEREF(obj5, obj4.dictLookup, "CS").isNull()) { +- blendingColorSpace = GfxColorSpace::parse(nullptr, &obj5, nullptr, state); ++ blendingColorSpace = std::unique_ptr<GfxColorSpace>(GfxColorSpace::parse(nullptr, &obj5, nullptr, state)); + } + _POPPLER_FREE(obj5); + if (_POPPLER_CALL_ARGS_DEREF(obj5, obj4.dictLookup, "I").isBool()) { +@@ -842,7 +842,7 @@ void PdfParser::opSetExtGState(Object args[], int /*numArgs*/) + } + } + } +- doSoftMask(&obj3, alpha, blendingColorSpace, isolated, knockout, funcs[0], &backdropColor); ++ doSoftMask(&obj3, alpha, blendingColorSpace.get(), isolated, knockout, funcs[0], &backdropColor); + if (funcs[0]) { + delete funcs[0]; + } +@@ -927,9 +927,6 @@ void PdfParser::doSoftMask(Object *str, GBool alpha, + alpha, transferFunc, backdropColor); + --formDepth; + +- if (blendingColorSpace) { +- delete blendingColorSpace; +- } + _POPPLER_FREE(obj1); + } + +@@ -946,42 +943,43 @@ void PdfParser::opSetRenderingIntent(Object /*args*/[], int /*numArgs*/) + * + * Maintains a cache for named color spaces to avoid expensive re-parsing. + */ +-GfxColorSpace *PdfParser::lookupColorSpaceCopy(Object &arg) ++std::unique_ptr<GfxColorSpace> PdfParser::lookupColorSpaceCopy(Object &arg) + { + assert(!arg.isNull()); +- GfxColorSpace *colorSpace = nullptr; + + if (char const *name = arg.isName() ? arg.getName() : nullptr) { + auto const cache_name = std::to_string(formDepth) + "-" + name; +- if ((colorSpace = colorSpacesCache[cache_name].get())) { +- return colorSpace->copy(); ++ if (auto cached = colorSpacesCache[cache_name].get()) { ++ return std::unique_ptr<GfxColorSpace>(cached->copy()); + } + +- Object obj = res->lookupColorSpace(name); +- if (obj.isNull()) { +- colorSpace = GfxColorSpace::parse(res, &arg, nullptr, state); ++ std::unique_ptr<GfxColorSpace> colorSpace; ++ if (auto obj = res->lookupColorSpace(name); !obj.isNull()) { ++ colorSpace = std::unique_ptr<GfxColorSpace>(GfxColorSpace::parse(res, &obj, nullptr, state)); + } else { +- colorSpace = GfxColorSpace::parse(res, &obj, nullptr, state); ++ colorSpace = std::unique_ptr<GfxColorSpace>(GfxColorSpace::parse(res, &arg, nullptr, state)); + } + + if (colorSpace && colorSpace->getMode() != csPattern) { +- colorSpacesCache[cache_name].reset(colorSpace->copy()); ++ colorSpacesCache[cache_name] = std::unique_ptr<GfxColorSpace>(colorSpace->copy()); + } ++ ++ return colorSpace; + } else { + // We were passed in an object directly. +- colorSpace = GfxColorSpace::parse(res, &arg, nullptr, state); ++ return std::unique_ptr<GfxColorSpace>(GfxColorSpace::parse(res, &arg, nullptr, state)); + } +- return colorSpace; + } + + /** + * Look up pattern/gradients from the GfxResource dictionary + */ +-GfxPattern *PdfParser::lookupPattern(Object *obj, GfxState *state) ++std::unique_ptr<GfxPattern> PdfParser::lookupPattern(Object *obj, GfxState *state) + { +- if (!obj->isName()) +- return nullptr; +- return res->lookupPattern(obj->getName(), nullptr, state); ++ if (!obj->isName()) { ++ return {}; ++ } ++ return std::unique_ptr<GfxPattern>(res->lookupPattern(obj->getName(), nullptr, state)); + } + + // TODO not good that numArgs is ignored but args[] is used: +@@ -990,7 +988,7 @@ void PdfParser::opSetFillGray(Object args[], int /*numArgs*/) + GfxColor color; + builder->beforeStateChange(state); + state->setFillPattern(nullptr); +- state->setFillColorSpace(new GfxDeviceGrayColorSpace()); ++ state->setFillColorSpace(_POPPLER_CONSUME_UNIQPTR_ARG(std::make_unique<GfxDeviceGrayColorSpace>())); + color.c[0] = dblToCol(args[0].getNum()); + state->setFillColor(&color); + builder->updateStyle(state); +@@ -1002,7 +1000,7 @@ void PdfParser::opSetStrokeGray(Object args[], int /*numArgs*/) + GfxColor color; + builder->beforeStateChange(state); + state->setStrokePattern(nullptr); +- state->setStrokeColorSpace(new GfxDeviceGrayColorSpace()); ++ state->setStrokeColorSpace(_POPPLER_CONSUME_UNIQPTR_ARG(std::make_unique<GfxDeviceGrayColorSpace>())); + color.c[0] = dblToCol(args[0].getNum()); + state->setStrokeColor(&color); + builder->updateStyle(state); +@@ -1015,7 +1013,7 @@ void PdfParser::opSetFillCMYKColor(Object args[], int /*numArgs*/) + int i; + builder->beforeStateChange(state); + state->setFillPattern(nullptr); +- state->setFillColorSpace(new GfxDeviceCMYKColorSpace()); ++ state->setFillColorSpace(_POPPLER_CONSUME_UNIQPTR_ARG(std::make_unique<GfxDeviceCMYKColorSpace>())); + for (i = 0; i < 4; ++i) { + color.c[i] = dblToCol(args[i].getNum()); + } +@@ -1029,7 +1027,7 @@ void PdfParser::opSetStrokeCMYKColor(Object args[], int /*numArgs*/) + GfxColor color; + builder->beforeStateChange(state); + state->setStrokePattern(nullptr); +- state->setStrokeColorSpace(new GfxDeviceCMYKColorSpace()); ++ state->setStrokeColorSpace(_POPPLER_CONSUME_UNIQPTR_ARG(std::make_unique<GfxDeviceCMYKColorSpace>())); + for (int i = 0; i < 4; ++i) { + color.c[i] = dblToCol(args[i].getNum()); + } +@@ -1043,7 +1041,7 @@ void PdfParser::opSetFillRGBColor(Object args[], int /*numArgs*/) + GfxColor color; + builder->beforeStateChange(state); + state->setFillPattern(nullptr); +- state->setFillColorSpace(new GfxDeviceRGBColorSpace()); ++ state->setFillColorSpace(_POPPLER_CONSUME_UNIQPTR_ARG(std::make_unique<GfxDeviceRGBColorSpace>())); + for (int i = 0; i < 3; ++i) { + color.c[i] = dblToCol(args[i].getNum()); + } +@@ -1056,7 +1054,7 @@ void PdfParser::opSetStrokeRGBColor(Object args[], int /*numArgs*/) { + GfxColor color; + builder->beforeStateChange(state); + state->setStrokePattern(nullptr); +- state->setStrokeColorSpace(new GfxDeviceRGBColorSpace()); ++ state->setStrokeColorSpace(_POPPLER_CONSUME_UNIQPTR_ARG(std::make_unique<GfxDeviceRGBColorSpace>())); + for (int i = 0; i < 3; ++i) { + color.c[i] = dblToCol(args[i].getNum()); + } +@@ -1068,14 +1066,14 @@ void PdfParser::opSetStrokeRGBColor(Object args[], int /*numArgs*/) { + void PdfParser::opSetFillColorSpace(Object args[], int numArgs) + { + assert(numArgs >= 1); +- GfxColorSpace *colorSpace = lookupColorSpaceCopy(args[0]); ++ auto colorSpace = lookupColorSpaceCopy(args[0]); + builder->beforeStateChange(state); + state->setFillPattern(nullptr); + + if (colorSpace) { + GfxColor color; +- state->setFillColorSpace(colorSpace); + colorSpace->getDefaultColor(&color); ++ state->setFillColorSpace(_POPPLER_CONSUME_UNIQPTR_ARG(colorSpace)); + state->setFillColor(&color); + builder->updateStyle(state); + } else { +@@ -1089,14 +1087,14 @@ void PdfParser::opSetStrokeColorSpace(Object args[], int numArgs) + assert(numArgs >= 1); + builder->beforeStateChange(state); + +- GfxColorSpace *colorSpace = lookupColorSpaceCopy(args[0]); ++ auto colorSpace = lookupColorSpaceCopy(args[0]); + + state->setStrokePattern(nullptr); + + if (colorSpace) { + GfxColor color; +- state->setStrokeColorSpace(colorSpace); + colorSpace->getDefaultColor(&color); ++ state->setStrokeColorSpace(_POPPLER_CONSUME_UNIQPTR_ARG(colorSpace)); + state->setStrokeColor(&color); + builder->updateStyle(state); + } else { +@@ -1159,7 +1157,7 @@ void PdfParser::opSetFillColorN(Object args[], int numArgs) { + builder->updateStyle(state); + } + if (auto pattern = lookupPattern(&(args[numArgs - 1]), state)) { +- state->setFillPattern(pattern); ++ state->setFillPattern(_POPPLER_CONSUME_UNIQPTR_ARG(pattern)); + builder->updateStyle(state); + } + +@@ -1202,7 +1200,7 @@ void PdfParser::opSetStrokeColorN(Object args[], int numArgs) { + builder->updateStyle(state); + } + if (auto pattern = lookupPattern(&(args[numArgs - 1]), state)) { +- state->setStrokePattern(pattern); ++ state->setStrokePattern(_POPPLER_CONSUME_UNIQPTR_ARG(pattern)); + builder->updateStyle(state); + } + +@@ -1579,11 +1577,11 @@ void PdfParser::doShadingPatternFillFallback(GfxShadingPattern *sPat, + // TODO not good that numArgs is ignored but args[] is used: + void PdfParser::opShFill(Object args[], int /*numArgs*/) + { +- GfxShading *shading = nullptr; + GfxPath *savedPath = nullptr; + bool savedState = false; + +- if (!(shading = res->lookupShading(args[0].getName(), nullptr, state))) { ++ auto shading = std::unique_ptr<GfxShading>(res->lookupShading(args[0].getName(), nullptr, state)); ++ if (!shading) { + return; + } + +@@ -1615,19 +1613,19 @@ void PdfParser::opShFill(Object args[], int /*numArgs*/) + // do shading type-specific operations + switch (shading->getType()) { + case 1: // Function-based shading +- doFunctionShFill(static_cast<GfxFunctionShading *>(shading)); ++ doFunctionShFill(static_cast<GfxFunctionShading *>(shading.get())); + break; + case 2: // Axial shading + case 3: // Radial shading +- builder->addClippedFill(shading, stateToAffine(state)); ++ builder->addClippedFill(shading.get(), stateToAffine(state)); + break; + case 4: // Free-form Gouraud-shaded triangle mesh + case 5: // Lattice-form Gouraud-shaded triangle mesh +- doGouraudTriangleShFill(static_cast<GfxGouraudTriangleShading *>(shading)); ++ doGouraudTriangleShFill(static_cast<GfxGouraudTriangleShading *>(shading.get())); + break; + case 6: // Coons patch mesh + case 7: // Tensor-product patch mesh +- doPatchMeshShFill(static_cast<GfxPatchMeshShading *>(shading)); ++ doPatchMeshShFill(static_cast<GfxPatchMeshShading *>(shading.get())); + break; + } + +@@ -1636,8 +1634,6 @@ void PdfParser::opShFill(Object args[], int /*numArgs*/) + restoreState(); + state->setPath(savedPath); + } +- +- delete shading; + } + + void PdfParser::doFunctionShFill(GfxFunctionShading *shading) { +@@ -2528,7 +2524,7 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + + } else { + // get color space and color map +- GfxColorSpace *colorSpace; ++ std::unique_ptr<GfxColorSpace> colorSpace; + _POPPLER_CALL_ARGS(obj1, dict->lookup, "ColorSpace"); + if (obj1.isNull()) { + _POPPLER_FREE(obj1); +@@ -2537,13 +2533,11 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + if (!obj1.isNull()) { + colorSpace = lookupColorSpaceCopy(obj1); + } else if (csMode == streamCSDeviceGray) { +- colorSpace = new GfxDeviceGrayColorSpace(); ++ colorSpace = std::make_unique<GfxDeviceGrayColorSpace>(); + } else if (csMode == streamCSDeviceRGB) { +- colorSpace = new GfxDeviceRGBColorSpace(); ++ colorSpace = std::make_unique<GfxDeviceRGBColorSpace>(); + } else if (csMode == streamCSDeviceCMYK) { +- colorSpace = new GfxDeviceCMYKColorSpace(); +- } else { +- colorSpace = nullptr; ++ colorSpace = std::make_unique<GfxDeviceCMYKColorSpace>(); + } + _POPPLER_FREE(obj1); + if (!colorSpace) { +@@ -2554,10 +2548,9 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + _POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, dict->lookup, "D"); + } +- GfxImageColorMap *colorMap = new GfxImageColorMap(bits, &obj1, colorSpace); ++ auto colorMap = std::make_unique<GfxImageColorMap>(bits, &obj1, _POPPLER_CONSUME_UNIQPTR_ARG(colorSpace)); + _POPPLER_FREE(obj1); + if (!colorMap->isOk()) { +- delete colorMap; + goto err1; + } + +@@ -2568,7 +2561,7 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + int maskWidth = 0; + int maskHeight = 0; + maskInvert = gFalse; +- GfxImageColorMap *maskColorMap = nullptr; ++ std::unique_ptr<GfxImageColorMap> maskColorMap; + _POPPLER_CALL_ARGS(maskObj, dict->lookup, "Mask"); + _POPPLER_CALL_ARGS(smaskObj, dict->lookup, "SMask"); + Dict* maskDict; +@@ -2624,7 +2617,7 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + _POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "CS"); + } +- GfxColorSpace *maskColorSpace = lookupColorSpaceCopy(obj1); ++ auto maskColorSpace = lookupColorSpaceCopy(obj1); + _POPPLER_FREE(obj1); + if (!maskColorSpace || maskColorSpace->getMode() != csDeviceGray) { + goto err1; +@@ -2634,10 +2627,9 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + _POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "D"); + } +- maskColorMap = new GfxImageColorMap(maskBits, &obj1, maskColorSpace); ++ maskColorMap = std::make_unique<GfxImageColorMap>(maskBits, &obj1, _POPPLER_CONSUME_UNIQPTR_ARG(maskColorSpace)); + _POPPLER_FREE(obj1); + if (!maskColorMap->isOk()) { +- delete maskColorMap; + goto err1; + } + //~ handle the Matte entry +@@ -2718,17 +2710,15 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + + // draw it + if (haveSoftMask) { +- builder->addSoftMaskedImage(state, str, width, height, colorMap, interpolate, +- maskStr, maskWidth, maskHeight, maskColorMap, maskInterpolate); +- delete maskColorMap; ++ builder->addSoftMaskedImage(state, str, width, height, colorMap.get(), interpolate, ++ maskStr, maskWidth, maskHeight, maskColorMap.get(), maskInterpolate); + } else if (haveExplicitMask) { +- builder->addMaskedImage(state, str, width, height, colorMap, interpolate, ++ builder->addMaskedImage(state, str, width, height, colorMap.get(), interpolate, + maskStr, maskWidth, maskHeight, maskInvert, maskInterpolate); + } else { +- builder->addImage(state, str, width, height, colorMap, interpolate, +- haveColorKeyMask ? maskColors : static_cast<int *>(nullptr)); ++ builder->addImage(state, str, width, height, colorMap.get(), interpolate, ++ haveColorKeyMask ? maskColors : nullptr); + } +- delete colorMap; + + _POPPLER_FREE(maskObj); + _POPPLER_FREE(smaskObj); +@@ -2746,7 +2736,6 @@ void PdfParser::doForm(Object *str, double *offset) + { + Dict *dict; + GBool transpGroup, isolated, knockout; +- GfxColorSpace *blendingColorSpace; + Object matrixObj, bboxObj; + double m[6], bbox[4]; + Object resObj; +@@ -2812,12 +2801,12 @@ void PdfParser::doForm(Object *str, double *offset) + + // check for a transparency group + transpGroup = isolated = knockout = gFalse; +- blendingColorSpace = nullptr; ++ std::unique_ptr<GfxColorSpace> blendingColorSpace; + if (_POPPLER_CALL_ARGS_DEREF(obj1, dict->lookup, "Group").isDict()) { + if (_POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "S").isName("Transparency")) { + transpGroup = gTrue; + if (!_POPPLER_CALL_ARGS_DEREF(obj3, obj1.dictLookup, "CS").isNull()) { +- blendingColorSpace = GfxColorSpace::parse(nullptr, &obj3, nullptr, state); ++ blendingColorSpace = std::unique_ptr<GfxColorSpace>(GfxColorSpace::parse(nullptr, &obj3, nullptr, state)); + } + _POPPLER_FREE(obj3); + if (_POPPLER_CALL_ARGS_DEREF(obj3, obj1.dictLookup, "I").isBool()) { +@@ -2835,12 +2824,9 @@ void PdfParser::doForm(Object *str, double *offset) + + // draw it + ++formDepth; +- doForm1(str, resDict, m, bbox, transpGroup, gFalse, blendingColorSpace, isolated, knockout); ++ doForm1(str, resDict, m, bbox, transpGroup, gFalse, blendingColorSpace.get(), isolated, knockout); + --formDepth; + +- if (blendingColorSpace) { +- delete blendingColorSpace; +- } + _POPPLER_FREE(resObj); + } + +diff --git a/src/extension/internal/pdfinput/pdf-parser.h b/src/extension/internal/pdfinput/pdf-parser.h +index c7c10caefed..8325ea24364 100644 +--- a/src/extension/internal/pdfinput/pdf-parser.h ++++ b/src/extension/internal/pdfinput/pdf-parser.h +@@ -137,7 +137,7 @@ public: + void loadPatternColorProfiles(Dict *resources); + void loadColorProfile(); + void loadColorSpaceProfile(GfxColorSpace *space, Object *obj); +- GfxPattern *lookupPattern(Object *obj, GfxState *state); ++ std::unique_ptr<GfxPattern> lookupPattern(Object *obj, GfxState *state); + + std::shared_ptr<CairoFontEngine> getFontEngine(); + +@@ -176,7 +176,7 @@ private: + //! Caches color spaces by name + std::map<std::string, std::unique_ptr<GfxColorSpace>> colorSpacesCache; + +- GfxColorSpace *lookupColorSpaceCopy(Object &); ++ std::unique_ptr<GfxColorSpace> lookupColorSpaceCopy(Object &); + + void setDefaultApproximationPrecision(); // init color deltas + void pushOperator(const char *name); +diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h +index 481aefadf46..8f03aa17779 100644 +--- a/src/extension/internal/pdfinput/poppler-transition-api.h ++++ b/src/extension/internal/pdfinput/poppler-transition-api.h +@@ -15,6 +15,12 @@ + #include <glib/poppler-features.h> + #include <poppler/UTF.h> + ++#if POPPLER_CHECK_VERSION(24, 10, 0) ++#define _POPPLER_CONSUME_UNIQPTR_ARG(value) std::move(value) ++#else ++#define _POPPLER_CONSUME_UNIQPTR_ARG(value) value.release() ++#endif ++ + #if POPPLER_CHECK_VERSION(24, 5, 0) + #define _POPPLER_HAS_UNICODE_BOM(value) (hasUnicodeByteOrderMark(value->toStr())) + #define _POPPLER_HAS_UNICODE_BOMLE(value) (hasUnicodeByteOrderMarkLE(value->toStr())) +-- +GitLab + diff --git a/media-gfx/inkscape/inkscape-1.4.ebuild b/media-gfx/inkscape/inkscape-1.4.ebuild index 29117135a3c6..33c9e981ae53 100644 --- a/media-gfx/inkscape/inkscape-1.4.ebuild +++ b/media-gfx/inkscape/inkscape-1.4.ebuild @@ -110,6 +110,7 @@ DEPEND="${COMMON_DEPEND} PATCHES=( "${FILESDIR}"/${PN}-1.4-gcc15.patch + "${FILESDIR}"/${PN}-1.4-poppler-24.10-fix-backport.patch ) pkg_pretend() { |