From 87e54b47abcea034cfcba6081f3596b2584a8322 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 24 Oct 2018 00:53:21 -0500 Subject: [PATCH] GIF: Fix the previous frame not always being decoded in _seek. _seek checked whether self.im is None, but if we've decoded a frame and then seeked back to 0, self.im will be set to the previously decoded frame. Instead, check if self.tile has data, which means _seek set up a tile to decode and it hasn't been decoded yet. --- Tests/images/rewind.gif | Bin 0 -> 142 bytes Tests/test_file_gif.py | 20 ++++++++++++++++++++ src/PIL/GifImagePlugin.py | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 Tests/images/rewind.gif diff --git a/Tests/images/rewind.gif b/Tests/images/rewind.gif new file mode 100644 index 0000000000000000000000000000000000000000..fea03b1d59c793847c36d4bde5e3cbf8a2913936 GIT binary patch literal 142 zcmZ?wbhEHbWM*JySj50^?>_?w{FkVzssgj1gyK&YRxSn>1|1L|q?Uo1jl)@Zu>vCl cP>RzCRf