diff --git a/app/render/framehashcache.cpp b/app/render/framehashcache.cpp index a7644d636..ab2e65f3c 100644 --- a/app/render/framehashcache.cpp +++ b/app/render/framehashcache.cpp @@ -197,6 +197,11 @@ bool FrameHashCache::SaveCacheFrame(const QByteArray &hash, FramePtr frame) cons bool FrameHashCache::SaveCacheFrame(const QString &cache_path, const QByteArray &hash, char *data, const VideoParams &vparam, int linesize_bytes) { + if (cache_path.isEmpty()) { + qWarning() << "Failed to save cache frame with empty path"; + return false; + } + QString fn = CachePathName(cache_path, hash); if (SaveCacheFrame(fn, data, vparam, linesize_bytes)) { @@ -226,6 +231,11 @@ bool FrameHashCache::SaveCacheFrame(const QString &cache_path, const QByteArray FramePtr FrameHashCache::LoadCacheFrame(const QString &cache_path, const QByteArray &hash) { + if (cache_path.isEmpty()) { + qWarning() << "Failed to save cache frame with empty path"; + return nullptr; + } + return LoadCacheFrame(CachePathName(cache_path, hash)); } diff --git a/app/render/renderprocessor.cpp b/app/render/renderprocessor.cpp index 9ab7615ea..adfba9ced 100644 --- a/app/render/renderprocessor.cpp +++ b/app/render/renderprocessor.cpp @@ -545,8 +545,12 @@ bool RenderProcessor::CanCacheFrames() QVariant RenderProcessor::GetCachedTexture(const QByteArray& hash) { - VideoParams video_params = GetCacheVideoParams(); QString cache_dir = ticket_->property("cache").toString(); + if (cache_dir.isEmpty()) { + return QVariant(); + } + + VideoParams video_params = GetCacheVideoParams(); FramePtr f = FrameHashCache::LoadCacheFrame(cache_dir, hash);