Skip to content
Snippets Groups Projects
Commit 018f4890 authored by Steve Lhomme's avatar Steve Lhomme
Browse files

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.
parent be937f8f
No related branches found
No related tags found
1 merge request!4485qt: fix crash when there is nothing to cache
Pipeline #402700 passed with stages
in 28 minutes and 58 seconds
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment