diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2016-10-15 15:07:05 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2016-10-16 12:51:01 +0800 |
commit | 1528a5955b0c1ab8ff07281d67cbc8d6a39ff203 (patch) | |
tree | 69fd1741d872c74d00d3935454d3d2d1a7d9762f /source | |
parent | 48338e8e0aa2ca1fc8eddaddc5e5bc258ee9bebb (diff) | |
download | mupdf-1528a5955b0c1ab8ff07281d67cbc8d6a39ff203.tar.xz |
gif: Do not paste frame data if frame and image do not overlap.
Diffstat (limited to 'source')
-rw-r--r-- | source/fitz/load-gif.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/fitz/load-gif.c b/source/fitz/load-gif.c index ae937c89..f41dee32 100644 --- a/source/fitz/load-gif.c +++ b/source/fitz/load-gif.c @@ -246,6 +246,13 @@ gif_read_tbid(fz_context *ctx, struct info *info, unsigned char *dest, unsigned mincodesize = *p; + /* if there is no overlap, avoid pasting image data, just consume it */ + if (info->image_top >= info->height || info->image_left >= info->width) + { + p = gif_read_subblocks(ctx, info, p + 1, end, NULL); + return p; + } + fz_var(compressed); fz_var(lzwstm); fz_var(uncompressed); |