Review Request 108708: fix possibly broken rect size calculation in Krita blur filters

Friedrich W. H. Kossebau kossebau at kde.org
Sat Feb 2 00:49:09 GMT 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/108708/
-----------------------------------------------------------

Review request for Calligra and Boudewijn Rempt.


Description
-------

MSVC hints in its warnings that using operator-() on an unsigned int will still result in an unsigned int.
Reading up the intertubes on that it seems to be usually the 2's complement of the value.
So all the rect calculations in these blur filter must have been giving strange results for quite some time.

Is that true? Nobody saw that?

Attached patch fixes that by always turning the values used for calculations into signed integer, by the implicit conversion coming with the assignment.

Other possible fixes would be to simply switch the operator-() usage into a -1* operation. Not sure what I prefer, your choice :)


Diffs
-----

  krita/plugins/filters/blur/kis_blur_filter.cpp b81f0bd 
  krita/plugins/filters/blur/kis_gaussian_blur_filter.cpp 0c68562 
  krita/plugins/filters/blur/kis_motion_blur_filter.cpp 6a13ca3 

Diff: http://git.reviewboard.kde.org/r/108708/diff/


Testing
-------

None, as I have no clue of the blur filters and how to see the effect of the patch. Left for Krita insiders.


Thanks,

Friedrich W. H. Kossebau

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20130202/83aa0e17/attachment.htm>


More information about the calligra-devel mailing list