summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Svetkin <mikhail.svetkin@qt.io>2018-04-05 15:08:15 +0200
committerMikhail Svetkin <mikhail.svetkin@qt.io>2018-04-10 09:29:30 +0000
commita5771345d9357d9d5ba65764c3aad3233df7fb6e (patch)
tree07b14aef62b86e285cd9d8913b26bbdcc0dee134
parenta1fd24ea94e655bbed8702c9e795fe21b34530da (diff)
Fix integer overflow (1 << 31)
On platforms where integer by default is int32(max is 2147483647) and (1 << 31) will be 2147483648 Change-Id: I59ccb5344d5ad7d085f01bbc7cebdf6152ff7755 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit f5a624c9b94455bebd7eb8fabbb300c4793fe6df)
-rw-r--r--src/gui/text/qfontdatabase.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 33dc27983a..e8b91cabe6 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -2864,7 +2864,7 @@ Q_GUI_EXPORT QStringList qt_sort_families_by_writing_system(QChar::Script script
uint order = i;
if (testFamily == nullptr
|| (testFamily->writingSystems[writingSystem] & QtFontFamily::Supported) == 0) {
- order |= 1 << 31;
+ order |= 1u << 31;
}
supported.insert(order, family);