Preventing crash where last_video_frame is NULL

This commit is contained in:
Jonathan Thomas
2020-01-08 00:09:01 -06:00
parent 4e5ba4d638
commit 187b2055dd

View File

@@ -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<int64_t, int64_t>(requested_frame, last_video_frame->number));
missing_video_frames_source.insert(std::pair<int64_t, int64_t>(last_video_frame->number, requested_frame));
missing_frames.Add(last_video_frame);