Update PIEX from tip of tree am: 79ea86a6a1 am: 3f7e2a1cb2

Original change: https://android-review.googlesource.com/c/platform/external/piex/+/2037563

Change-Id: I3711d4b6e14b40f3e9eea64a2c80e5cc87462be9
This commit is contained in:
Jesse Evans
2022-03-23 00:55:20 +00:00
committed by Automerger Merge Worker
3 changed files with 6 additions and 5 deletions

View File

@@ -183,13 +183,14 @@ class ArwTypeChecker : public TypeChecker {
// Search for (kSignatureFileTypeSection + kSignatureVersions[i]) in first // Search for (kSignatureFileTypeSection + kSignatureVersions[i]) in first
// requested bytes // requested bytes
const string kSignatureSection("\x00\xb0\x01\x00\x04\x00\x00\x00", 8); const string kSignatureSection("\x00\xb0\x01\x00\x04\x00\x00\x00", 8);
const int kSignatureVersionsSize = 5; const int kSignatureVersionsSize = 6;
const string kSignatureVersions[kSignatureVersionsSize] = { const string kSignatureVersions[kSignatureVersionsSize] = {
string("\x02\x00", 2), // ARW 1.0 string("\x02\x00", 2), // ARW 1.0
string("\x03\x00", 2), // ARW 2.0 string("\x03\x00", 2), // ARW 2.0
string("\x03\x01", 2), // ARW 2.1 string("\x03\x01", 2), // ARW 2.1
string("\x03\x02", 2), // ARW 2.2 string("\x03\x02", 2), // ARW 2.2
string("\x03\x03", 2), // ARW 2.3 string("\x03\x03", 2), // ARW 2.3
string("\x04\x00", 2), // ARW 4.0
}; };
bool matched = false; bool matched = false;
for (int i = 0; i < kSignatureVersionsSize; ++i) { for (int i = 0; i < kSignatureVersionsSize; ++i) {

View File

@@ -283,9 +283,9 @@ bool GetOlympusPreviewImage(StreamInterface* stream,
} }
if (raw_processing_ifd.Has(kOlymTagAspectFrame)) { if (raw_processing_ifd.Has(kOlymTagAspectFrame)) {
std::vector<std::uint32_t> aspect_frame(4); std::vector<std::uint32_t> aspect_frame;
if (raw_processing_ifd.Get(kOlymTagAspectFrame, &aspect_frame) && if (raw_processing_ifd.Get(kOlymTagAspectFrame, &aspect_frame) &&
aspect_frame[2] > aspect_frame[0] && aspect_frame.size() == 4 && aspect_frame[2] > aspect_frame[0] &&
aspect_frame[3] > aspect_frame[1]) { aspect_frame[3] > aspect_frame[1]) {
preview_image_data->full_width = aspect_frame[2] - aspect_frame[0] + 1; preview_image_data->full_width = aspect_frame[2] - aspect_frame[0] + 1;
preview_image_data->full_height = aspect_frame[3] - aspect_frame[1] + 1; preview_image_data->full_height = aspect_frame[3] - aspect_frame[1] + 1;

View File

@@ -720,8 +720,8 @@ bool TiffParser::ParseIfd(const std::uint32_t ifd_offset,
IfdVector* tiff_directory) { IfdVector* tiff_directory) {
std::uint32_t next_ifd_offset; std::uint32_t next_ifd_offset;
TiffDirectory tiff_ifd(static_cast<Endian>(endian_)); TiffDirectory tiff_ifd(static_cast<Endian>(endian_));
if (!ParseDirectory(tiff_offset_, ifd_offset, endian_, desired_tags, if (!ParseDirectory(tiff_offset_, ifd_offset, endian_, desired_tags, stream_,
stream_, &tiff_ifd, &next_ifd_offset) || &tiff_ifd, &next_ifd_offset) ||
!ParseSubIfds(tiff_offset_, desired_tags, max_number_ifds, endian_, !ParseSubIfds(tiff_offset_, desired_tags, max_number_ifds, endian_,
stream_, &tiff_ifd)) { stream_, &tiff_ifd)) {
return false; return false;