[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor-browser] 23/36: Bug 1786259 - Avoid potential deadlock via AddWithLegacyFamilyName when shared-fontlist is disabled (incl. safe mode). r=gfx-reviewers, aosmond a=RyanVM
This is an automated email from the git hooks/post-receive script.
pierov pushed a commit to annotated tag FIREFOX_102_4_0esr_BUILD1
in repository tor-browser.
commit f0440910d05cbd5866553086efc1667af6ce4711
Author: Jonathan Kew <jkew@xxxxxxxxxxx>
AuthorDate: Wed Sep 14 12:50:23 2022 +0000
Bug 1786259 - Avoid potential deadlock via AddWithLegacyFamilyName when shared-fontlist is disabled (incl. safe mode). r=gfx-reviewers,aosmond a=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D157311
---
gfx/thebes/gfxFontEntry.cpp | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/gfx/thebes/gfxFontEntry.cpp b/gfx/thebes/gfxFontEntry.cpp
index bbd48c2a3696..26e7fca49bec 100644
--- a/gfx/thebes/gfxFontEntry.cpp
+++ b/gfx/thebes/gfxFontEntry.cpp
@@ -2040,8 +2040,16 @@ bool gfxFontFamily::CheckForLegacyFamilyNames(gfxPlatformFontList* aFontList) {
mCheckedForLegacyFamilyNames = true;
bool added = false;
const uint32_t kNAME = TRUETYPE_TAG('n', 'a', 'm', 'e');
- AutoReadLock lock(mLock);
- for (const auto& fe : mAvailableFonts) {
+ AutoTArray<RefPtr<gfxFontEntry>, 16> faces;
+ {
+ // Take a local copy of the array of font entries, because it's possible
+ // AddWithLegacyFamilyName will mutate it (and it needs to be able to take
+ // an exclusive lock on the family to do so, so we release the read lock
+ // here).
+ AutoReadLock lock(mLock);
+ faces.AppendElements(mAvailableFonts);
+ }
+ for (const auto& fe : faces) {
if (!fe) {
continue;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits