From b645d59b1e170af1cb0963935bd8c915e56c431c Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 13 Nov 2020 15:59:29 +0000 Subject: Issue #1683 - Update Brotli lib to 1.0.9 --- modules/brotli/enc/block_splitter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/brotli/enc/block_splitter.c') diff --git a/modules/brotli/enc/block_splitter.c b/modules/brotli/enc/block_splitter.c index d308eca59..deb7c2e15 100644 --- a/modules/brotli/enc/block_splitter.c +++ b/modules/brotli/enc/block_splitter.c @@ -132,7 +132,7 @@ void BrotliSplitBlock(MemoryManager* m, { size_t literals_count = CountLiterals(cmds, num_commands); uint8_t* literals = BROTLI_ALLOC(m, uint8_t, literals_count); - if (BROTLI_IS_OOM(m)) return; + if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(literals)) return; /* Create a continuous array of literals. */ CopyLiteralsToByteArray(cmds, num_commands, data, pos, mask, literals); /* Create the block split on the array of literals. @@ -150,7 +150,7 @@ void BrotliSplitBlock(MemoryManager* m, /* Compute prefix codes for commands. */ uint16_t* insert_and_copy_codes = BROTLI_ALLOC(m, uint16_t, num_commands); size_t i; - if (BROTLI_IS_OOM(m)) return; + if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(insert_and_copy_codes)) return; for (i = 0; i < num_commands; ++i) { insert_and_copy_codes[i] = cmds[i].cmd_prefix_; } @@ -170,7 +170,7 @@ void BrotliSplitBlock(MemoryManager* m, uint16_t* distance_prefixes = BROTLI_ALLOC(m, uint16_t, num_commands); size_t j = 0; size_t i; - if (BROTLI_IS_OOM(m)) return; + if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(distance_prefixes)) return; for (i = 0; i < num_commands; ++i) { const Command* cmd = &cmds[i]; if (CommandCopyLen(cmd) && cmd->cmd_prefix_ >= 128) { -- cgit v1.2.3