Fixing possible out of bound memory access
authorsugoi <sugoi@chromium.org>
Thu, 19 Feb 2015 13:32:08 +0000 (05:32 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 19 Feb 2015 13:32:09 +0000 (05:32 -0800)
commitf421ec6cc9c8f32d717b9b1df71fd9e79817a16c
tree14284d46a64e0669e21f16d67306a7bcf122eb3e
parentcd87c51de6bf81ed232b5d828c88771829c0bf76
Fixing possible out of bound memory access

This was a bug found by ASAN. When width is very small, we can have something like width == 1 and rowBytes == 8. Using "2 * yWidth" (2) would be smaller than rowBytesY (8), so we could read memory out of bounds. This issue has a separate fix in blink (crbug.com/458861).

BUG=skia:

Review URL: https://codereview.chromium.org/936133003
src/images/SkImageDecoder_libjpeg.cpp