From de8931dae4403532487b3a5599d08d4b8d9e43c3 Mon Sep 17 00:00:00 2001 From: Ivan Baravy Date: Wed, 30 Dec 2020 03:21:38 +0000 Subject: [PATCH] kiv: fix a bug (crash) after image rotation, fix memory leak. git-svn-id: svn://kolibrios.org@8496 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/media/kiv/trunk/kiv.asm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/programs/media/kiv/trunk/kiv.asm b/programs/media/kiv/trunk/kiv.asm index 216305b3b9..e1867cc3db 100644 --- a/programs/media/kiv/trunk/kiv.asm +++ b/programs/media/kiv/trunk/kiv.asm @@ -466,10 +466,11 @@ button: mov eax, [cur_image] cmp eax, [orig_image] jz @f - invoke img.destroy, [cur_image] - mov [cur_image], 0 + push dword[esp] + invoke img.rotate, [cur_image] @@: invoke img.rotate, [orig_image] + mov [bNewImage], 1 jmp redraw_all ; rotate right @@ -1676,6 +1677,11 @@ proc scale_none_calc mov [scale_mode], LIBIMG_SCALE_NONE + mov eax, [cur_image] + cmp eax, [orig_image] + jz @f + invoke img.destroy, eax +@@: mov eax, [orig_image] mov [cur_image], eax mov [cur_frame], eax