diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-06-15 14:57:03 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-06-15 14:57:03 +0100 |
commit | d18bf1e01b65ee4bf0c804e2843b282d3d4e5d7c (patch) | |
tree | 4a95cbc6ffdf13bad6ecbc7f8d5af99631984123 /kde-frameworks/kio/files/kio-5.80.1-fix-crash-in-ThumbnailProtocol.patch | |
parent | e748ba9741f6540f4675c23e3e37b73e822c13a4 (diff) |
gentoo resync : 15.06.2021
Diffstat (limited to 'kde-frameworks/kio/files/kio-5.80.1-fix-crash-in-ThumbnailProtocol.patch')
-rw-r--r-- | kde-frameworks/kio/files/kio-5.80.1-fix-crash-in-ThumbnailProtocol.patch | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/kde-frameworks/kio/files/kio-5.80.1-fix-crash-in-ThumbnailProtocol.patch b/kde-frameworks/kio/files/kio-5.80.1-fix-crash-in-ThumbnailProtocol.patch deleted file mode 100644 index 059c9f824241..000000000000 --- a/kde-frameworks/kio/files/kio-5.80.1-fix-crash-in-ThumbnailProtocol.patch +++ /dev/null @@ -1,104 +0,0 @@ -From a68cb73c4e071ed24b18a95e11fbbbc8d59840b4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?M=C3=A9ven=20Car?= <meven29@gmail.com> -Date: Sun, 21 Mar 2021 05:22:57 +0100 -Subject: [PATCH] PreviewJob: Initialize cachesSize with 0, only pass size > 0 - to shmget, improve createThumbnail - -BUG: 430862 ---- - src/widgets/previewjob.cpp | 48 +++++++++++++++++++++++--------------- - 1 file changed, 29 insertions(+), 19 deletions(-) - -diff --git a/src/widgets/previewjob.cpp b/src/widgets/previewjob.cpp -index 988da16b0..9b6e661e8 100644 ---- a/src/widgets/previewjob.cpp -+++ b/src/widgets/previewjob.cpp -@@ -70,7 +70,7 @@ public: - : initialItems(items) - , width(size.width()) - , height(size.height()) -- , cacheSize(-1) -+ , cacheSize(0) - , bScale(true) - , bSave(true) - , ignoreMaximumSize(false) -@@ -114,8 +114,8 @@ public: - // Size of thumbnail - int width; - int height; -- // Unscaled size of thumbnail (128 or 256 if cache is enabled) -- int cacheSize; -+ // Unscaled size of thumbnail (128, 256 or 512 if cache is enabled) -+ ushort cacheSize; - // Whether the thumbnail should be scaled - bool bScale; - // Whether we should save the thumbnail -@@ -712,39 +712,49 @@ void PreviewJobPrivate::createThumbnail(const QString &pixPath) - }); - - bool save = bSave && currentItem.plugin->property(QStringLiteral("CacheThumbnail")).toBool() && !sequenceIndex; -+ int thumb_width = width; -+ int thumb_height = height; -+ int thumb_iconSize = iconSize; -+ if (save) { -+ thumb_width = thumb_height = cacheSize; -+ thumb_iconSize = 64; -+ } -+ - job->addMetaData(QStringLiteral("mimeType"), currentItem.item.mimetype()); -- job->addMetaData(QStringLiteral("width"), QString().setNum(save ? cacheSize : width)); -- job->addMetaData(QStringLiteral("height"), QString().setNum(save ? cacheSize : height)); -- job->addMetaData(QStringLiteral("iconSize"), QString().setNum(save ? 64 : iconSize)); -- job->addMetaData(QStringLiteral("iconAlpha"), QString().setNum(iconAlpha)); -+ job->addMetaData(QStringLiteral("width"), QString::number(thumb_width)); -+ job->addMetaData(QStringLiteral("height"), QString::number(thumb_height)); -+ job->addMetaData(QStringLiteral("iconSize"), QString::number(thumb_iconSize)); -+ job->addMetaData(QStringLiteral("iconAlpha"), QString::number(iconAlpha)); - job->addMetaData(QStringLiteral("plugin"), currentItem.plugin->library()); - job->addMetaData(QStringLiteral("enabledPlugins"), enabledPlugins.join(QLatin1Char(','))); - job->addMetaData(QStringLiteral("devicePixelRatio"), QString::number(devicePixelRatio)); - if (sequenceIndex) { -- job->addMetaData(QStringLiteral("sequence-index"), QString().setNum(sequenceIndex)); -+ job->addMetaData(QStringLiteral("sequence-index"), QString::number(sequenceIndex)); - } - - #if WITH_SHM - if (shmid == -1) { - if (shmaddr) { -+ // clean previous shared memory segment - shmdt((char *)shmaddr); - shmctl(shmid, IPC_RMID, nullptr); -+ shmaddr = nullptr; - } -- auto size = std::max(cacheSize * cacheSize, width * height); -- shmid = shmget(IPC_PRIVATE, size * 4 * devicePixelRatio * devicePixelRatio, IPC_CREAT | 0600); -- if (shmid != -1) { -- shmaddr = (uchar *)(shmat(shmid, nullptr, SHM_RDONLY)); -- if (shmaddr == (uchar *)-1) { -- shmctl(shmid, IPC_RMID, nullptr); -- shmaddr = nullptr; -- shmid = -1; -+ auto size = thumb_width * thumb_height; -+ if (size > 0) { -+ shmid = shmget(IPC_PRIVATE, size * 4 * devicePixelRatio * devicePixelRatio, IPC_CREAT | 0600); -+ if (shmid != -1) { -+ shmaddr = (uchar *)(shmat(shmid, nullptr, SHM_RDONLY)); -+ if (shmaddr == (uchar *)-1) { -+ shmctl(shmid, IPC_RMID, nullptr); -+ shmaddr = nullptr; -+ shmid = -1; -+ } - } -- } else { -- shmaddr = nullptr; - } - } - if (shmid != -1) { -- job->addMetaData(QStringLiteral("shmid"), QString().setNum(shmid)); -+ job->addMetaData(QStringLiteral("shmid"), QString::number(shmid)); - } - #endif - } --- -GitLab - |