diff --git a/src/doc/compressed_image.cpp b/src/doc/compressed_image.cpp index b654db345..a1f80e456 100644 --- a/src/doc/compressed_image.cpp +++ b/src/doc/compressed_image.cpp @@ -42,20 +42,21 @@ CompressedImage::CompressedImage(const Image* image, scanline.x = x; for (++x; xwidth(); ++x) { + if (maskBitmap && !get_pixel_fast(maskBitmap, x, y)) + break; + c2 = get_pixel(image, x, y); if (diffColors && c1 != c2) break; - if (maskBitmap && !get_pixel_fast(maskBitmap, x, y)) - break; - if (!diffColors && !maskBitmap && c2 == mask) break; } scanline.w = x - scanline.x; - m_scanlines.push_back(scanline); + if (scanline.w > 0) + m_scanlines.push_back(scanline); } } }