From b39a6dbd61b4ff309e482bd81533322ff37350c4 Mon Sep 17 00:00:00 2001 From: Will Robertson Date: Sat, 22 Oct 2016 08:51:52 +1100 Subject: [PATCH] Pause playback when loading a new GIF to avoid errors --- libgif.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libgif.js b/libgif.js index b14e0e9..ba711e5 100644 --- a/libgif.js +++ b/libgif.js @@ -898,6 +898,9 @@ if (callback) load_callback = callback; else load_callback = false; + // Pause playback before the doStep() callback fires and frames[] is blank + player.pause(); + loading = true; frames = []; clear();