From 6d8eebbf7b7229c93b51e1f82c1cf980a4a7c79e Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 13 Feb 2016 17:42:17 +0100 Subject: VIDEO: Stay on the first edit when playing QT videos backwards We don't support playing videos with multiple edits backwards. Taking the code path to move to the next edit when playing backwards sets the current edit index to an invalid value with the video still trying to play. Which results in out of bounds reads, and ultimately a crash. This fixes multiple crashes in Myst. Using the key without the chest on Stoneship, resetting the clock tower puzzle, and using the switch in the trees in Channelwood. This was a regression introduced in a59f5db505ffce9567c3bc8adf30d2f843910d65. --- video/qt_decoder.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'video/qt_decoder.cpp') diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp index 324bf65294..49034aad17 100644 --- a/video/qt_decoder.cpp +++ b/video/qt_decoder.cpp @@ -447,7 +447,9 @@ const Graphics::Surface *QuickTimeDecoder::VideoTrackHandler::decodeNextFrame() } // Update the edit list, if applicable - if (endOfCurEdit()) { + // FIXME: Add support for playing backwards videos with more than one edit + // For now, stay on the first edit for reversed playback + if (endOfCurEdit() && !_reversed) { _curEdit++; if (atLastEdit()) -- cgit v1.2.3