initialize-imagemagick.patch 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. From 76ff65aec63be4036955e89bf7136a5e9411e6b1 Mon Sep 17 00:00:00 2001
  2. From: Antonio Rojas <arojas@archlinux.org>
  3. Date: Thu, 7 Nov 2019 09:25:02 +0100
  4. Subject: Properly initialize ExceptionInfo in libMagick
  5. Otherwise it will crash if some plugins can't be loaded.
  6. Differential Revision: https://phabricator.kde.org/D25181
  7. ---
  8. core/dplugins/dimg/imagemagick/dimgimagemagickplugin.cpp | 6 +++---
  9. core/tests/dimg/magickloader.cpp | 2 +-
  10. 2 files changed, 4 insertions(+), 4 deletions(-)
  11. diff --git a/core/dplugins/dimg/imagemagick/dimgimagemagickplugin.cpp b/core/dplugins/dimg/imagemagick/dimgimagemagickplugin.cpp
  12. index 1858b4d..20ef01b 100644
  13. --- a/core/dplugins/dimg/imagemagick/dimgimagemagickplugin.cpp
  14. +++ b/core/dplugins/dimg/imagemagick/dimgimagemagickplugin.cpp
  15. @@ -125,7 +125,7 @@ QMap<QString, QString> DImgImageMagickPlugin::extraAboutData() const
  16. QString mimes = typeMimes();
  17. QMap<QString, QString> map;
  18. - ExceptionInfo ex;
  19. + ExceptionInfo ex = *AcquireExceptionInfo();
  20. size_t n = 0;
  21. const MagickInfo** inflst = GetMagickInfoList("*", &n, &ex);
  22. @@ -219,7 +219,7 @@ int DImgImageMagickPlugin::canRead(const QFileInfo& fileInfo, bool magic) const
  23. int DImgImageMagickPlugin::canWrite(const QString& format) const
  24. {
  25. QStringList formats;
  26. - ExceptionInfo ex;
  27. + ExceptionInfo ex = *AcquireExceptionInfo();
  28. size_t n = 0;
  29. const MagickInfo** inflst = GetMagickInfoList("*", &n, &ex);
  30. @@ -266,7 +266,7 @@ DImgLoader* DImgImageMagickPlugin::loader(DImg* const image, const DRawDecoding&
  31. QStringList DImgImageMagickPlugin::decoderFormats() const
  32. {
  33. QStringList formats;
  34. - ExceptionInfo ex;
  35. + ExceptionInfo ex = *AcquireExceptionInfo();
  36. size_t n = 0;
  37. const MagickInfo** inflst = GetMagickInfoList("*", &n, &ex);
  38. diff --git a/core/tests/dimg/magickloader.cpp b/core/tests/dimg/magickloader.cpp
  39. index 2526779..73f2abe 100644
  40. --- a/core/tests/dimg/magickloader.cpp
  41. +++ b/core/tests/dimg/magickloader.cpp
  42. @@ -127,7 +127,7 @@ int main(int argc, char** argv)
  43. {
  44. MagickCoreGenesis((char*)NULL, MagickFalse);
  45. - ExceptionInfo ex;
  46. + ExceptionInfo ex = *AcquireExceptionInfo();
  47. size_t n = 0;
  48. const MagickInfo** inflst = GetMagickInfoList("*", &n, &ex);
  49. --
  50. cgit v1.1