diff options
author | Leon Scroggins III <scroggo@google.com> | 2015-01-27 11:12:02 -0500 |
---|---|---|
committer | Leon Scroggins <scroggo@google.com> | 2015-01-27 16:41:16 +0000 |
commit | a730ef3f77fc495bc90199b4d45efab26d609782 (patch) | |
tree | f88830bbe9186aacc9f79c849dce761f61ef875a /include | |
parent | aa6945ac7904611499ae4ad33799d1f1fe434d32 (diff) | |
download | frameworks_base-a730ef3f77fc495bc90199b4d45efab26d609782.zip frameworks_base-a730ef3f77fc495bc90199b4d45efab26d609782.tar.gz frameworks_base-a730ef3f77fc495bc90199b4d45efab26d609782.tar.bz2 |
Handle bad ninepatch data.
Changes proposed by Ben Hawkes of Google Project Zero.
NinePatchPeeker.cpp:
Instead of asserting, return false for bad data.
ResourceTypes.h:
Store ninepatch values as unsigned.
BUG:19151999
Change-Id: Ibe35e7569f632c6bb8a34a7701e26bb6ed547ec2
Diffstat (limited to 'include')
-rw-r--r-- | include/androidfw/ResourceTypes.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/androidfw/ResourceTypes.h b/include/androidfw/ResourceTypes.h index f2d85b4..bf993f4 100644 --- a/include/androidfw/ResourceTypes.h +++ b/include/androidfw/ResourceTypes.h @@ -118,9 +118,9 @@ struct Res_png_9patch yDivsOffset(0), colorsOffset(0) { } int8_t wasDeserialized; - int8_t numXDivs; - int8_t numYDivs; - int8_t numColors; + uint8_t numXDivs; + uint8_t numYDivs; + uint8_t numColors; // The offset (from the start of this structure) to the xDivs & yDivs // array for this 9patch. To get a pointer to this array, call |