Fix image decoder memory overwrite bug.
authorscroggo <scroggo@google.com>
Fri, 25 Jul 2014 20:54:43 +0000 (13:54 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 25 Jul 2014 20:54:43 +0000 (13:54 -0700)
commitfc7063b3a50f4cf0801301f7b7b7b119f6b41cf8
tree19ad14f5c6c31ab1f1ced475ab5c73c97940d6d3
parentd6aeb6dc8fe21066f1a2c4813a4256a3acd3edf5
Fix image decoder memory overwrite bug.

In SkPNGImageDecoder::onDecodeSubset, use png_read_rows to write to
the scratch memory provided. This is what we should have been doing
anyway. Further, writing directly to the bitmap can cause writing
to the wrong memory since the bitmap may not be as big as the
scratch memory in the case of sampling with a short bitmap.

Bug=b/13921093

R=djsollen@google.com

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/423473003
src/images/SkImageDecoder_libpng.cpp