Update third_party/libwebm to commit f4b07ec
Bug: aomedia:356830476
Change-Id: I1070ef1683bb6fc5ffe4d7a7f3dbf532ed9c0253
(cherry picked from commit 0a5353aac2a7c05d0ceccade798a29e4ac37cbfe)
diff --git a/third_party/libwebm/README.libaom b/third_party/libwebm/README.libaom
index 1eb0ce9..a038418 100644
--- a/third_party/libwebm/README.libaom
+++ b/third_party/libwebm/README.libaom
@@ -1,5 +1,5 @@
URL: https://chromium.googlesource.com/webm/libwebm
-Version: affd7f4d9644aa2b65981fa6c7616400be760e6e
+Version: f4b07ec144e61d9089144e8d54b4ecda0219c562
License: BSD
License File: LICENSE.TXT
diff --git a/third_party/libwebm/common/hdr_util.cc b/third_party/libwebm/common/hdr_util.cc
index 916f717..f1320a5 100644
--- a/third_party/libwebm/common/hdr_util.cc
+++ b/third_party/libwebm/common/hdr_util.cc
@@ -202,7 +202,8 @@
features->bit_depth = priv_profile;
} else if (id_byte == kVp9ChromaSubsamplingId) {
const int priv_profile = static_cast<int>(private_data[offset++]);
- if (priv_profile != 0 && priv_profile != 2 && priv_profile != 3)
+ if (priv_profile != 0 && priv_profile != 1 && priv_profile != 2 &&
+ priv_profile != 3)
return false;
if (features->chroma_subsampling != Vp9CodecFeatures::kValueNotPresent &&
features->chroma_subsampling != priv_profile) {
diff --git a/third_party/libwebm/mkvmuxer/mkvmuxerutil.cc b/third_party/libwebm/mkvmuxer/mkvmuxerutil.cc
index f538310..d1e835c 100644
--- a/third_party/libwebm/mkvmuxer/mkvmuxerutil.cc
+++ b/third_party/libwebm/mkvmuxer/mkvmuxerutil.cc
@@ -621,7 +621,7 @@
#ifdef _WIN32
(void)seed;
const int32 nn = rand();
-#elif __ANDROID__
+#elif defined(__ANDROID__)
(void)seed;
int32 temp_num = 1;
int fd = open("/dev/urandom", O_RDONLY);
diff --git a/third_party/libwebm/mkvmuxer/mkvwriter.cc b/third_party/libwebm/mkvmuxer/mkvwriter.cc
index d668384..9b714a5 100644
--- a/third_party/libwebm/mkvmuxer/mkvwriter.cc
+++ b/third_party/libwebm/mkvmuxer/mkvwriter.cc
@@ -80,8 +80,14 @@
return _fseeki64(file_, position, SEEK_SET);
#elif defined(_WIN32)
return fseeko64(file_, static_cast<off_t>(position), SEEK_SET);
-#else
+#elif !(defined(__ANDROID__) && __ANDROID_API__ < 24 && !defined(__LP64__) && \
+ defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ // POSIX.1 has fseeko and ftello. fseeko and ftello are not available before
+ // Android API level 24. See
+ // https://android.googlesource.com/platform/bionic/+/main/docs/32-bit-abi.md
return fseeko(file_, static_cast<off_t>(position), SEEK_SET);
+#else
+ return fseek(file_, static_cast<long>(position), SEEK_SET);
#endif
}
diff --git a/third_party/libwebm/mkvparser/mkvreader.cc b/third_party/libwebm/mkvparser/mkvreader.cc
index 9d19c1b..4672604 100644
--- a/third_party/libwebm/mkvparser/mkvreader.cc
+++ b/third_party/libwebm/mkvparser/mkvreader.cc
@@ -120,8 +120,14 @@
return -1; // error
#elif defined(_WIN32)
fseeko64(m_file, static_cast<off_t>(offset), SEEK_SET);
-#else
+#elif !(defined(__ANDROID__) && __ANDROID_API__ < 24 && !defined(__LP64__) && \
+ defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ // POSIX.1 has fseeko and ftello. fseeko and ftello are not available before
+ // Android API level 24. See
+ // https://android.googlesource.com/platform/bionic/+/main/docs/32-bit-abi.md
fseeko(m_file, static_cast<off_t>(offset), SEEK_SET);
+#else
+ fseek(m_file, static_cast<long>(offset), SEEK_SET);
#endif
const size_t size = fread(buffer, 1, len, m_file);