NANCY: Silence potential nullptr dereference warning

This commit is contained in:
Kaloyan Chehlarski 2023-03-07 00:13:39 +02:00
parent 779e22f4a8
commit 0f28c64d6a

View File

@ -79,6 +79,9 @@ void AVFDecoder::addFrameTime(const uint16 timeToAdd) {
// Custom function to allow the last frame of the video to play correctly
bool AVFDecoder::atEnd() const {
const AVFDecoder::AVFVideoTrack *track = ((const AVFDecoder::AVFVideoTrack *)getTrack(0));
if (!track) {
return true;
}
return !track->isReversed() && track->endOfTrack() && track->getFrameTime(track->getFrameCount()) <= getTime();
}