From 1fcb5f2d197e47478621b298dbab661708c958a6 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sat, 15 Apr 2017 16:29:12 -0700 Subject: [PATCH] GUACAMOLE-250: Fix backward seeking - must retreat potentially all the way to frame 0 in search of an absolute state. --- .../src/main/webapp/modules/SessionRecording.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/guacamole-common-js/src/main/webapp/modules/SessionRecording.js b/guacamole-common-js/src/main/webapp/modules/SessionRecording.js index 34f8aca4d..5922f1726 100644 --- a/guacamole-common-js/src/main/webapp/modules/SessionRecording.js +++ b/guacamole-common-js/src/main/webapp/modules/SessionRecording.js @@ -205,10 +205,15 @@ Guacamole.SessionRecording = function SessionRecording(tunnel) { var startIndex; // Back up until startIndex represents current state - for (startIndex = index; startIndex > currentFrame; startIndex--) { + for (startIndex = index; startIndex >= 0; startIndex--) { var frame = frames[startIndex]; + // If we've reached the current frame, startIndex represents + // current state by definition + if (startIndex === currentFrame) + break; + // If frame has associated absolute state, make that frame the // current state if (frame.clientState) {