DescriptionCorrectly calculate remaining span length in Neon fallback blitter
In the non-Neon optimized fallback in SCALE_NOFILTER_NAME() the pixels
are first processed in groups of 4, followed by the final remaining 0-3
pixels depending on the span length.
Currently the remaining span length (0-3) pixels is incorrectly
calculated as count - count / 4. This generally causes the function to
access outside the bounds of the input and/or output bitmaps.
The correct formula is count % 4, because all the full multiples of 4
pixels have been processed and only the remainder remains.
Bug spotted by Xianzhu Wang.
TEST=None, because this part of the code isn't actually even being compiled due
to the !defined(__ARM_HAVE_NEON) guard at the top of the file. It was compiled
in by mistake in Chrome for Android, which is how this bug was spotted.
Committed: https://code.google.com/p/skia/source/detail?r=4777
Patch Set 1 #
MessagesTotal messages: 3
|