wsd/DocumentBroker.cpp |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit a8924e6e6f0cfa88b2ef96a73f0de2686c26508e
Author:     Michael Meeks <michael.me...@collabora.com>
AuthorDate: Wed Nov 6 00:33:37 2019 +0000
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Wed Nov 6 00:33:37 2019 +0000

    avoid crash prior to load when _tileCache is not yet created.
    
    Change-Id: Ic8b3b25af23df7638f0ccf48740f2267612e4e8b

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 754844e89..5a0926a2d 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -291,7 +291,8 @@ void DocumentBroker::pollThread()
 
 #if !MOBILEAPP
         // a tile's data is ~8k, a 4k screen is ~128 256x256 tiles
-        _tileCache->setMaxCacheSize(8 * 1024 * 128 * _sessions.size());
+        if (_tileCache)
+            _tileCache->setMaxCacheSize(8 * 1024 * 128 * _sessions.size());
 
         if (!_isLoaded && (limit_load_secs > 0) && (now > loadDeadline))
         {
@@ -1474,7 +1475,8 @@ bool DocumentBroker::handleInput(const std::vector<char>& 
payload)
 
 size_t DocumentBroker::getMemorySize() const
 {
-    return sizeof(DocumentBroker) + _tileCache->getMemorySize() +
+    return sizeof(DocumentBroker) +
+        (!!_tileCache ? _tileCache->getMemorySize() : 0) +
         _sessions.size() * sizeof(ClientSession);
 }
 
@@ -2171,7 +2173,8 @@ void DocumentBroker::dumpState(std::ostream& os)
     os << "\n  last saved: " << std::ctime(&t);
     os << "\n  cursor " << _cursorPosX << ", " << _cursorPosY
       << "( " << _cursorWidth << "," << _cursorHeight << ")\n";
-    _tileCache->dumpState(os);
+    if (_tileCache)
+        _tileCache->dumpState(os);
 
     _poll->dumpState(os);
 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to