Loading libs/androidfw/ZipUtils.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ class FileReader : public zip_archive::Reader { explicit FileReader(FILE* fp) : Reader(), mFp(fp), mCurrentOffset(0) { } bool ReadAtOffset(uint8_t* buf, size_t len, uint32_t offset) const { bool ReadAtOffset(uint8_t* buf, size_t len, off64_t offset) const { // Data is usually requested sequentially, so this helps avoid pointless // fseeks every time we perform a read. There's an impedence mismatch // here because the original API was designed around pread and pwrite. Loading @@ -63,7 +63,7 @@ class FileReader : public zip_archive::Reader { private: FILE* mFp; mutable uint32_t mCurrentOffset; mutable off64_t mCurrentOffset; }; class FdReader : public zip_archive::Reader { Loading @@ -71,8 +71,8 @@ class FdReader : public zip_archive::Reader { explicit FdReader(int fd) : mFd(fd) { } bool ReadAtOffset(uint8_t* buf, size_t len, uint32_t offset) const { return android::base::ReadFullyAtOffset(mFd, buf, len, static_cast<off_t>(offset)); bool ReadAtOffset(uint8_t* buf, size_t len, off64_t offset) const { return android::base::ReadFullyAtOffset(mFd, buf, len, offset); } private: Loading @@ -86,8 +86,8 @@ class BufferReader : public zip_archive::Reader { mInputSize(inputSize) { } bool ReadAtOffset(uint8_t* buf, size_t len, uint32_t offset) const { if (offset + len > mInputSize) { bool ReadAtOffset(uint8_t* buf, size_t len, off64_t offset) const { if (mInputSize < len || offset > mInputSize - len) { return false; } Loading Loading
libs/androidfw/ZipUtils.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ class FileReader : public zip_archive::Reader { explicit FileReader(FILE* fp) : Reader(), mFp(fp), mCurrentOffset(0) { } bool ReadAtOffset(uint8_t* buf, size_t len, uint32_t offset) const { bool ReadAtOffset(uint8_t* buf, size_t len, off64_t offset) const { // Data is usually requested sequentially, so this helps avoid pointless // fseeks every time we perform a read. There's an impedence mismatch // here because the original API was designed around pread and pwrite. Loading @@ -63,7 +63,7 @@ class FileReader : public zip_archive::Reader { private: FILE* mFp; mutable uint32_t mCurrentOffset; mutable off64_t mCurrentOffset; }; class FdReader : public zip_archive::Reader { Loading @@ -71,8 +71,8 @@ class FdReader : public zip_archive::Reader { explicit FdReader(int fd) : mFd(fd) { } bool ReadAtOffset(uint8_t* buf, size_t len, uint32_t offset) const { return android::base::ReadFullyAtOffset(mFd, buf, len, static_cast<off_t>(offset)); bool ReadAtOffset(uint8_t* buf, size_t len, off64_t offset) const { return android::base::ReadFullyAtOffset(mFd, buf, len, offset); } private: Loading @@ -86,8 +86,8 @@ class BufferReader : public zip_archive::Reader { mInputSize(inputSize) { } bool ReadAtOffset(uint8_t* buf, size_t len, uint32_t offset) const { if (offset + len > mInputSize) { bool ReadAtOffset(uint8_t* buf, size_t len, off64_t offset) const { if (mInputSize < len || offset > mInputSize - len) { return false; } Loading