From 187b2055ddd73dcbeedff02a46e7f2df64db7dd6 Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Wed, 8 Jan 2020 00:09:01 -0600 Subject: [PATCH] Preventing crash where last_video_frame is NULL --- src/FFmpegReader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FFmpegReader.cpp b/src/FFmpegReader.cpp index 2bd5c53f..9234ecfe 100644 --- a/src/FFmpegReader.cpp +++ b/src/FFmpegReader.cpp @@ -2086,7 +2086,7 @@ bool FFmpegReader::CheckMissingFrame(int64_t requested_frame) { // CPU time looking for missing images for all the audio-only frames. if (checked_frames[requested_frame] > 8 && !missing_video_frames.count(requested_frame) && !processing_audio_frames.count(requested_frame) && processed_audio_frames.count(requested_frame) && - last_frame && last_video_frame->has_image_data && aCodecId == AV_CODEC_ID_MP3 && (vCodecId == AV_CODEC_ID_MJPEGB || vCodecId == AV_CODEC_ID_MJPEG)) { + last_frame && last_video_frame && last_video_frame->has_image_data && aCodecId == AV_CODEC_ID_MP3 && (vCodecId == AV_CODEC_ID_MJPEGB || vCodecId == AV_CODEC_ID_MJPEG)) { missing_video_frames.insert(std::pair(requested_frame, last_video_frame->number)); missing_video_frames_source.insert(std::pair(last_video_frame->number, requested_frame)); missing_frames.Add(last_video_frame);