From c3dc3ea59f25de57703390123a14039fb7a2c0eb Mon Sep 17 00:00:00 2001 From: HJ Imbens Date: Wed, 25 Nov 2015 09:35:57 +0100 Subject: [PATCH] Fix rle encoding, first byte of run was added to previous non-run. --- app/xcf/xcf-save.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/xcf/xcf-save.c b/app/xcf/xcf-save.c index fd981c0b67..eeee9e914c 100644 --- a/app/xcf/xcf-save.c +++ b/app/xcf/xcf-save.c @@ -1654,6 +1654,13 @@ xcf_save_tile_rle (XcfInfo *info, { const guchar *t; + /* if we came here because of a new run, backup one */ + if (!((length == 32768) || ((size - length) == 0))) + { + length--; + data -= bpp; + } + count += length; state = 0;