Merge "Ensure correct read of jpeg header blob" into tm-dev am: e2d9f79f35
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18624617 Change-Id: Idc7f74ab022786e2c11b6cf4517ec6bbbd60eaf1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -123,10 +123,15 @@ uint32_t Image_getBlobSize(LockedImage* buffer, bool usingRGBAOverride) {
|
||||
|
||||
// First check for BLOB transport header at the end of the buffer
|
||||
uint8_t* header = blobBuffer + (width - sizeof(struct camera3_jpeg_blob_v2));
|
||||
struct camera3_jpeg_blob_v2 *blob = (struct camera3_jpeg_blob_v2*)(header);
|
||||
if (blob->jpeg_blob_id == CAMERA3_JPEG_BLOB_ID ||
|
||||
blob->jpeg_blob_id == CAMERA3_HEIC_BLOB_ID) {
|
||||
size = blob->jpeg_size;
|
||||
|
||||
// read camera3_jpeg_blob_v2 from the end of the passed buffer.
|
||||
// requires memcpy because 'header' might not be properly aligned.
|
||||
struct camera3_jpeg_blob_v2 blob;
|
||||
memcpy(&blob, header, sizeof(struct camera3_jpeg_blob_v2));
|
||||
|
||||
if (blob.jpeg_blob_id == CAMERA3_JPEG_BLOB_ID ||
|
||||
blob.jpeg_blob_id == CAMERA3_HEIC_BLOB_ID) {
|
||||
size = blob.jpeg_size;
|
||||
ALOGV("%s: Jpeg/Heic size = %d", __FUNCTION__, size);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user