summaryrefslogtreecommitdiffstats
path: root/camera/src/camera_metadata.c
diff options
context:
space:
mode:
Diffstat (limited to 'camera/src/camera_metadata.c')
-rw-r--r--camera/src/camera_metadata.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/camera/src/camera_metadata.c b/camera/src/camera_metadata.c
index dc80086..e99abc4 100644
--- a/camera/src/camera_metadata.c
+++ b/camera/src/camera_metadata.c
@@ -228,6 +228,12 @@ camera_metadata_t *allocate_copy_camera_metadata_checked(
return NULL;
}
+ if (src_size < sizeof(camera_metadata_t)) {
+ ALOGE("%s: Source size too small!", __FUNCTION__);
+ android_errorWriteLog(0x534e4554, "67782345");
+ return NULL;
+ }
+
void *buffer = malloc(src_size);
memcpy(buffer, src, src_size);