media codec2: Remove use of hardcoded PAGE_SIZE 4096
bionic hard codes the PAGE_SIZE macro as 4096. This is going away as
Android begins to support larger page sizes. Remove the usage of this
assumption from media codec2 source; use instead getpagesize() which
provides the real pagesize.
Test: mma
Bug: 295016003
Change-Id: If70250d4ef1e838756082974abd4d2e41e28f343
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
diff --git a/media/codec2/fuzzer/C2Fuzzer.cpp b/media/codec2/fuzzer/C2Fuzzer.cpp
index d6793e0..719962d 100644
--- a/media/codec2/fuzzer/C2Fuzzer.cpp
+++ b/media/codec2/fuzzer/C2Fuzzer.cpp
@@ -239,6 +239,7 @@
}
void Codec2Fuzzer::decodeFrames(const uint8_t* data, size_t size) {
+ static const size_t kPageSize = getpagesize();
std::unique_ptr<BufferSource> bufferSource = std::make_unique<BufferSource>(data, size);
if (!bufferSource) {
return;
@@ -270,7 +271,7 @@
work->input.ordinal.timestamp = 0;
work->input.ordinal.frameIndex = ++numFrames;
work->input.buffers.clear();
- int32_t alignedSize = C2FUZZER_ALIGN(frameSize, PAGE_SIZE);
+ int32_t alignedSize = C2FUZZER_ALIGN(frameSize, kPageSize);
std::shared_ptr<C2LinearBlock> block;
status = mLinearPool->fetchLinearBlock(