Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Fix stack use after return in KoFontGlyphModel

Luna Lovecraftf51335c629c5
diff --git a/libs/flake/text/KoFontGlyphModel.cpp b/libs/flake/text/KoFontGlyphModel.cpp
index 3384dabac6..73ff07147e 100644
--- a/libs/flake/text/KoFontGlyphModel.cpp
+++ b/libs/flake/text/KoFontGlyphModel.cpp
@@ -477,8 +477,8 @@ QModelIndex KoFontGlyphModel::index(int row, int column, const QModelIndex &pare
if (parent.isValid() && parent.row() >= 0 && parent.row() < d->codePoints.size()) {
Private::CodePointInfo info = d->codePoints.at(parent.row());
if (row >= 0 && row < info.glyphs.size()) {
- Private::GlyphInfo glyphInfo = info.glyphs.at(row);
- return createIndex(row, column, &glyphInfo);
+ const Private::GlyphInfo &glyphInfo = info.glyphs.at(row);
+ return createIndex(row, column, const_cast<void*>(reinterpret_cast<const void*>(&glyphInfo)));
}
} else if (row >= 0 && row < d->codePoints.size()) {