Merge "Fix build" into nyc-dev

This commit is contained in:
Jaesung Chung
2016-04-06 12:50:30 +00:00
committed by Android (Google) Code Review

View File

@@ -882,7 +882,7 @@ MtpResponseCode MyMtpDatabase::getObjectInfo(MtpObjectHandle handle,
break; break;
} }
info.mThumbCompressedSize = image_data.thumbnail_length; info.mThumbCompressedSize = image_data.thumbnail.length;
info.mThumbFormat = MTP_FORMAT_EXIF_JPEG; info.mThumbFormat = MTP_FORMAT_EXIF_JPEG;
info.mImagePixWidth = image_data.full_width; info.mImagePixWidth = image_data.full_width;
info.mImagePixHeight = image_data.full_height; info.mImagePixHeight = image_data.full_height;
@@ -932,19 +932,19 @@ void* MyMtpDatabase::getThumbnail(MtpObjectHandle handle, size_t& outThumbSize)
break; break;
} }
if (image_data.thumbnail_length == 0) { if (image_data.thumbnail.length == 0) {
// No thumbnail. // No thumbnail.
break; break;
} }
result = malloc(image_data.thumbnail_length); result = malloc(image_data.thumbnail.length);
if (result) { if (result) {
piex::Error err = stream.get()->GetData( piex::Error err = stream.get()->GetData(
image_data.thumbnail_offset, image_data.thumbnail.offset,
image_data.thumbnail_length, image_data.thumbnail.length,
(std::uint8_t *)result); (std::uint8_t *)result);
if (err == piex::Error::kOk) { if (err == piex::Error::kOk) {
outThumbSize = image_data.thumbnail_length; outThumbSize = image_data.thumbnail.length;
} else { } else {
free(result); free(result);
} }