diff options
Diffstat (limited to 'src/android/camera_metadata.cpp')
-rw-r--r-- | src/android/camera_metadata.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/android/camera_metadata.cpp b/src/android/camera_metadata.cpp index 59366c50..ebe43ba4 100644 --- a/src/android/camera_metadata.cpp +++ b/src/android/camera_metadata.cpp @@ -137,7 +137,8 @@ bool CameraMetadata::addEntry(uint32_t tag, const void *data, size_t count, return false; } -bool CameraMetadata::updateEntry(uint32_t tag, const void *data, size_t count) +bool CameraMetadata::updateEntry(uint32_t tag, const void *data, size_t count, + size_t elementSize) { if (!valid_) return false; @@ -152,6 +153,14 @@ bool CameraMetadata::updateEntry(uint32_t tag, const void *data, size_t count) return false; } + if (camera_metadata_type_size[entry.type] != elementSize) { + const char *name = get_camera_metadata_tag_name(tag); + LOG(CameraMetadata, Fatal) + << "Invalid element size for tag " + << (name ? name : "<unknown>"); + return false; + } + size_t oldSize = calculate_camera_metadata_entry_data_size(entry.type, entry.count); |