From c7f696b50f9f34a4ecda4ec900f7cd32e742e1b2 Mon Sep 17 00:00:00 2001 From: Ivan Baravy Date: Sat, 3 Nov 2018 17:36:45 +0000 Subject: [PATCH] Libimg: Fix bug with 16-bit BMP padding. git-svn-id: svn://kolibrios.org@7523 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/develop/libraries/libs-dev/libimg/bmp/bmp.asm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/programs/develop/libraries/libs-dev/libimg/bmp/bmp.asm b/programs/develop/libraries/libs-dev/libimg/bmp/bmp.asm index 6a26af93d2..0aadc75b89 100644 --- a/programs/develop/libraries/libs-dev/libimg/bmp/bmp.asm +++ b/programs/develop/libraries/libs-dev/libimg/bmp/bmp.asm @@ -967,6 +967,8 @@ locals unshift bmp.RgbByteQuad mask bmp.RgbQuad delta dd ? + dataoff dd ? ; offset of encoded data + ; row data are aligned on dword from data start, not file start endl mov [delta], 4 @@ -1018,6 +1020,7 @@ endl mov edi, [edx + Image.Data] pop esi + mov [dataoff], esi ;;------------------------------------------------------------------------------------------------;; @@ -1068,6 +1071,10 @@ endl dec ecx jnz .next_pixel + sub esi, [dataoff] + add esi, 3 + and esi, not 3 + add esi, [dataoff] pop ecx dec ecx jnz .next_line