summaryrefslogtreecommitdiff
path: root/libs/androidfw/StringPool.cpp
diff options
context:
space:
mode:
author Avichal Rakesh <arakesh@google.com> 2022-05-26 22:59:15 +0000
committer Avichal Rakesh <arakesh@google.com> 2022-06-03 21:21:52 +0000
commit1877b47b1bcd53b3d40525d2cb22d0160ee0eaa1 (patch)
tree5cbf7775074620ab3122140941a33e23388e4e44 /libs/androidfw/StringPool.cpp
parent99945d5d70e0cdbffcc00cdeeb4d8c8d8a2a908e (diff)
Ensure correct read of jpeg header blob
When using HIDL HAL, camera service rewrites jpeg header to match camera3_jpeg_blob_v2 struct. The original buffer might be generated to use the HIDL header which might have a smaller size and different memory alignment requirements than camera3_jpeg_blob_v2. CameraServer puts the header as the very last bytes of the incoming buffer. Since the size and location of buffer is variable, it is possible that directly reading the header values from the bufffer fails because of memory alignment requirements. This CL uses memcpy to extract the header into the stack to ensure we don't run into memory alignment errors when reading the header from the jpeg buffer. Bug: 233986162 Test: Camera CTS Passes, and verified by partner Change-Id: I8d7ef872b4c7319349ebd1c5e83707ef4724c744
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions