mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 848270 - Various fixups for Android builds on OSX after bug 847479. r=nfroyd
This commit is contained in:
parent
9798c87e1e
commit
51a7a6e6e7
@ -49,12 +49,6 @@ struct SeekableZStreamHeader: public Zip::SignedEntity<SeekableZStreamHeader>
|
||||
|
||||
/* Filter Id */
|
||||
unsigned char filter;
|
||||
|
||||
/* Maximum supported size for chunkSize */
|
||||
/* Can't use std::min here because it's not constexpr */
|
||||
static const size_t maxChunkSize =
|
||||
1 << ((sizeof(chunkSize) < sizeof(lastChunkSize) ?
|
||||
sizeof(chunkSize) : sizeof(lastChunkSize)) - 1);
|
||||
};
|
||||
#pragma pack()
|
||||
|
||||
|
@ -16,13 +16,18 @@
|
||||
#include "Utils.h"
|
||||
#include "Logging.h"
|
||||
|
||||
/* Maximum supported size for chunkSize */
|
||||
static const size_t maxChunkSize =
|
||||
1 << (8 * std::min(sizeof(((SeekableZStreamHeader *)NULL)->chunkSize),
|
||||
sizeof(((SeekableZStreamHeader *)NULL)->lastChunkSize)) - 1);
|
||||
|
||||
class Buffer: public MappedPtr
|
||||
{
|
||||
public:
|
||||
virtual bool Resize(size_t size)
|
||||
{
|
||||
void *buf = mmap(NULL, size, PROT_READ | PROT_WRITE,
|
||||
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||
MAP_PRIVATE | MAP_ANON, -1, 0);
|
||||
if (buf == MAP_FAILED)
|
||||
return false;
|
||||
if (*this != MAP_FAILED)
|
||||
@ -334,8 +339,7 @@ int main(int argc, char* argv[])
|
||||
if (!firstArg[0])
|
||||
break;
|
||||
if (!GetSize(firstArg[0], &chunkSize) || !chunkSize ||
|
||||
(chunkSize % 4096) ||
|
||||
(chunkSize > SeekableZStreamHeader::maxChunkSize)) {
|
||||
(chunkSize % 4096) || (chunkSize > maxChunkSize)) {
|
||||
log("Invalid chunk size");
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user