OSDN Git Service

Make Bitmap_createFromParcel check the color count. DO NOT MERGE
authorLeon Scroggins III <scroggo@google.com>
Wed, 11 Mar 2015 17:12:06 +0000 (13:12 -0400)
committerThe Android Automerger <android-build@google.com>
Thu, 9 Jul 2015 21:04:55 +0000 (14:04 -0700)
commitd44e5bde18a41beda39d49189bef7f2ba7c8f3cb
treebf01666ec8db5fae35664bb8fd25a75e9eb91a95
parent0e40462e11d27eb859b829b112cecb8c6f0d7afb
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: Iab0d218c41ae0c39606e333e44cda078eef32291
core/jni/android/graphics/Bitmap.cpp