From 7e353a1ec5dfa2f0e558b3ab6a6672758d8ec319 Mon Sep 17 00:00:00 2001 From: berak Date: Tue, 7 Aug 2018 11:43:37 +0200 Subject: [PATCH] videoio: check iterator in mjpeg_encoder.cpp --- modules/videoio/src/cap_mjpeg_decoder.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/videoio/src/cap_mjpeg_decoder.cpp b/modules/videoio/src/cap_mjpeg_decoder.cpp index f8ba6857f3..02400fd9f0 100644 --- a/modules/videoio/src/cap_mjpeg_decoder.cpp +++ b/modules/videoio/src/cap_mjpeg_decoder.cpp @@ -146,6 +146,9 @@ bool MotionJpegCapture::grabFrame() } else { + if (m_frame_iterator == m_mjpeg_frames.end()) + return false; + ++m_frame_iterator; } }