[vlc-commits] [Git][videolan/vlc][master] qt: fix crash when there is nothing to cache

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Nov 4 13:04:31 UTC 2023


Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
018f4890 by Steve Lhomme at 2023-11-04T11:30:32+00:00
qt: fix crash when there is nothing to cache

On a fresh install of VLC compiler with mingw LLVM17 I get a crash when
accessing m_cachedData. The pointer is NULL because the queryCount is 0.

- - - - -


1 changed file:

- modules/gui/qt/util/listcache.hxx


Changes:

=====================================
modules/gui/qt/util/listcache.hxx
=====================================
@@ -479,6 +479,9 @@ void ListCache<T>::asyncCountAndLoad()
             size_t queryCount = (m_limit > 0)
                 ? std::min(m_limit, maximumCount)
                 : maximumCount;
+
+            if (queryCount == 0)
+                return;
             //note: should we drop items past queryCount?
             m_cachedData = std::make_unique<CacheData>(std::move(list),
                                                        queryCount,



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/018f4890c161b3d1179771b8fd5f9987f1f172fa

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/018f4890c161b3d1179771b8fd5f9987f1f172fa
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list