diff options
| author | Kenny Root <kenny@the-b.org> | 2009-08-21 15:23:45 -0500 |
|---|---|---|
| committer | Kenny Root <kenny@the-b.org> | 2009-08-21 15:23:45 -0500 |
| commit | 841ce8b7b9fffcc66cf1349097ed821b94627d63 (patch) | |
| tree | 748ab250a25f8013bcf30be39ff502adc6615ad9 /tools/aapt/StringPool.cpp | |
| parent | 83bad3df01504e08d5a8520e46e01754bd5109b9 (diff) | |
| download | frameworks_base-841ce8b7b9fffcc66cf1349097ed821b94627d63.zip frameworks_base-841ce8b7b9fffcc66cf1349097ed821b94627d63.tar.gz frameworks_base-841ce8b7b9fffcc66cf1349097ed821b94627d63.tar.bz2 | |
Fix bitmask in aapt's StringPool length construction
The StringPool indicates the length of a string with a 16-bit
integer. If the length of the string is greater than 0x7FFF,
it splits it into two 16-bit integers with the first one
having the high bit set.
The length calculation has a small bug that masks off the
19 bits instead of the first 15 bits as intended.
Diffstat (limited to 'tools/aapt/StringPool.cpp')
| -rw-r--r-- | tools/aapt/StringPool.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/aapt/StringPool.cpp b/tools/aapt/StringPool.cpp index 878d3b1..715170a 100644 --- a/tools/aapt/StringPool.cpp +++ b/tools/aapt/StringPool.cpp @@ -228,7 +228,7 @@ status_t StringPool::writeStringBlock(const sp<AaptFile>& pool) } dat += (preSize+strPos)/sizeof(uint16_t); if (lenSize > sizeof(uint16_t)) { - *dat = htods(0x8000 | ((strSize>>16)&0x7ffff)); + *dat = htods(0x8000 | ((strSize>>16)&0x7fff)); dat++; } *dat++ = htods(strSize); |
