[Digikam-devel] [Bug 207710] Crash while loading large file (Digikam::DImgScale::dimgScaleAARGB, Digikam::DImg::smoothScaleSection, Digikam::DImgInterface::paintOnDevice)

Daniel Scharrer dscharrer at gmail.com
Fri Sep 3 19:55:30 BST 2010


https://bugs.kde.org/show_bug.cgi?id=207710





--- Comment #25 from Daniel Scharrer <dscharrer gmail com>  2010-09-03 20:55:16 ---
Created an attachment (id=51288)
 --> (http://bugs.kde.org/attachment.cgi?id=51288)
fix overflow in DImgScale::dimgCalc*Points functions for large images

The dimgCalcYPoints dimgCalcYPoints16 dimgCalcXPoints and dimgCalcApoints
functions in libdigikamcore.so (digikam/libs/dimg/dimgscale.cpp) incorrectly
assume that the width and height can be represented by a (signed) int after
being shifted 16 bits to the left. On x86 and amd64 platforms this only leaves
15 Bits: larger width/height values will be shifted into the sign bit. Hence
for images with a width or height greater than 1<<15=32768 the increment will
be negative and hell breaks loose.

This can however be fixed by using a 64-bit type for the temporary values (see
attached patch). The attached patch shouldn't impact performance on 32-bit
platforms too much, as the changes only affect loops over the image (section)
width OR over the height, but not nested loops over all pixels.

With a patched libdigikamcore.so, showFoto will not crash while scaling down
large images to display them.

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Digikam-devel mailing list