Skip to content

Commit 187b205

Browse files
committed
Preventing crash where last_video_frame is NULL
1 parent 4e5ba4d commit 187b205

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/FFmpegReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2086,7 +2086,7 @@ bool FFmpegReader::CheckMissingFrame(int64_t requested_frame) {
20862086
// CPU time looking for missing images for all the audio-only frames.
20872087
if (checked_frames[requested_frame] > 8 && !missing_video_frames.count(requested_frame) &&
20882088
!processing_audio_frames.count(requested_frame) && processed_audio_frames.count(requested_frame) &&
2089-
last_frame && last_video_frame->has_image_data && aCodecId == AV_CODEC_ID_MP3 && (vCodecId == AV_CODEC_ID_MJPEGB || vCodecId == AV_CODEC_ID_MJPEG)) {
2089+
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)) {
20902090
missing_video_frames.insert(std::pair<int64_t, int64_t>(requested_frame, last_video_frame->number));
20912091
missing_video_frames_source.insert(std::pair<int64_t, int64_t>(last_video_frame->number, requested_frame));
20922092
missing_frames.Add(last_video_frame);

0 commit comments

Comments
 (0)