diff options
author | Zhijun He <zhijunhe@google.com> | 2014-03-27 16:46:15 -0700 |
---|---|---|
committer | Zhijun He <zhijunhe@google.com> | 2014-03-27 18:39:04 -0700 |
commit | 7595c47b4842d76dba0fcf26ef3ab98d215efe1e (patch) | |
tree | 8b69a34d2e3ad17d22eadfad281065cda707ed21 /camera | |
parent | 5bdb3c4d93269511d21d155c78790ee70d423095 (diff) | |
download | frameworks_av-7595c47b4842d76dba0fcf26ef3ab98d215efe1e.tar.gz frameworks_av-7595c47b4842d76dba0fcf26ef3ab98d215efe1e.tar.bz2 frameworks_av-7595c47b4842d76dba0fcf26ef3ab98d215efe1e.zip |
CameraMetadata: Fix String tag update null character issue
String8.size() doesn't count the null character in whatever case. But camera
metadata tag android.jpeg.gpsProcessingMethod need a null-terminited string.
Bug: 13679912
Change-Id: I91e742702b16b9ab9b42f9822de189a9a96e8e53
Diffstat (limited to 'camera')
-rw-r--r-- | camera/CameraMetadata.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/camera/CameraMetadata.cpp b/camera/CameraMetadata.cpp index 6b726e06eb..1567cd1813 100644 --- a/camera/CameraMetadata.cpp +++ b/camera/CameraMetadata.cpp @@ -273,7 +273,8 @@ status_t CameraMetadata::update(uint32_t tag, if ( (res = checkType(tag, TYPE_BYTE)) != OK) { return res; } - return updateImpl(tag, (const void*)string.string(), string.size()); + // string.size() doesn't count the null termination character. + return updateImpl(tag, (const void*)string.string(), string.size() + 1); } status_t CameraMetadata::updateImpl(uint32_t tag, const void *data, |