OSDN Git Service

Make Bitmap_createFromParcel check the color count. DO NOT MERGE
authorLeon Scroggins III <scroggo@google.com>
Wed, 15 Apr 2015 12:16:29 +0000 (08:16 -0400)
committerLeon Scroggins III <scroggo@google.com>
Wed, 15 Apr 2015 12:16:29 +0000 (08:16 -0400)
commit69b8e962e1b8346b33a2c14889547a0ac00c8b17
treecc34f6ec5aab7d7bb1a97d52fbef79cbeea3269f
parent9a425aa71c0ae6fb8c9c84d3e71321a44433d861
Make Bitmap_createFromParcel check the color count. DO NOT MERGE

When reading from the parcel, if the number of colors is invalid, early
exit.

Add two more checks: setInfo must return true, and Parcel::readInplace
must return non-NULL. The former ensures that the previously read values
(width, height, etc) were valid, and the latter checks that the Parcel
had enough data even if the number of colors was reasonable.

Also use an auto-deleter to handle deletion of the SkBitmap.

Cherry pick from change-Id: Icbd562d6d1f131a723724883fd31822d337cf5a6

BUG=19666945

Change-Id: I9490d90244e051a4019d6266b2a1cb375a65198f
core/jni/android/graphics/Bitmap.cpp