cache: null check on saving frames

Includes a warning since I'm not sure yet if this is problematic behavior
or not yet.
This commit is contained in:
itsmattkc
2020-07-23 18:46:47 +10:00
parent 867e3729f4
commit ce486f6b84
+5 -1
View File
@@ -193,7 +193,11 @@ void FrameHashCache::SaveCacheFrame(const QByteArray& hash,
void FrameHashCache::SaveCacheFrame(const QByteArray &hash, FramePtr frame)
{
SaveCacheFrame(hash, frame->data(), frame->video_params(), frame->linesize_bytes());
if (frame) {
SaveCacheFrame(hash, frame->data(), frame->video_params(), frame->linesize_bytes());
} else {
qWarning() << "Attempted to save a NULL frame to the cache. This may or may not be desirable.";
}
}
FramePtr FrameHashCache::LoadCacheFrame(const QByteArray &hash)