From 1f6d1be7fc609ae436b8ab9e8674ba05163ed8e9 Mon Sep 17 00:00:00 2001 From: Riley Lahd Date: Fri, 8 Mar 2019 12:57:53 -0700 Subject: [PATCH] Ensure disposal key exists before checking --- src/PIL/GifImagePlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PIL/GifImagePlugin.py b/src/PIL/GifImagePlugin.py index 44c32faeb..7ba178d39 100644 --- a/src/PIL/GifImagePlugin.py +++ b/src/PIL/GifImagePlugin.py @@ -443,7 +443,7 @@ def _write_multiple_frames(im, fp, palette): if im_frames: # delta frame previous = im_frames[-1] - if encoderinfo["disposal"] == 2: + if "disposal" in encoderinfo and encoderinfo["disposal"] == 2: # If diposing whole frame, treat full new frame as delta delta = im_frame elif _get_palette_bytes(im_frame) == \