From afb3ae303461668d4807eaa047a5585a7c870adc Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Fri, 7 Feb 2014 12:40:59 +0100 Subject: WINTERMUTE: Treat edge case - prevents crash if SRT file is blank. --- engines/wintermute/video/video_subtitler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'engines/wintermute') diff --git a/engines/wintermute/video/video_subtitler.cpp b/engines/wintermute/video/video_subtitler.cpp index f1becb00b3..0ade366fb5 100644 --- a/engines/wintermute/video/video_subtitler.cpp +++ b/engines/wintermute/video/video_subtitler.cpp @@ -185,6 +185,12 @@ bool VideoSubtitler::display() { } bool VideoSubtitler::update(long frame) { + + if (_subtitles.size() == 0) { + // Edge case: we have loaded subtitles early on... from a blank file. + return false; + } + if (frame != _lastSample) { /* * If the frame count hasn't advanced the previous state still matches -- cgit v1.2.3