summaryrefslogtreecommitdiffstats
path: root/modules/brotli/enc/block_splitter.c
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-11-20 09:47:03 +0000
committerMoonchild <moonchild@palemoon.org>2020-11-20 09:47:03 +0000
commit5165ed02285315cc0bed7977c7bac6d0a90ca43c (patch)
tree9b761a21eb924915e51c2d803208e6c01b505a45 /modules/brotli/enc/block_splitter.c
parente1db27e19989db11fef70f439cf95821316535b3 (diff)
parentca9abcdf1702c37bf00048dab3f460b2252873a3 (diff)
downloadUXP-5165ed02285315cc0bed7977c7bac6d0a90ca43c.tar
UXP-5165ed02285315cc0bed7977c7bac6d0a90ca43c.tar.gz
UXP-5165ed02285315cc0bed7977c7bac6d0a90ca43c.tar.lz
UXP-5165ed02285315cc0bed7977c7bac6d0a90ca43c.tar.xz
UXP-5165ed02285315cc0bed7977c7bac6d0a90ca43c.zip
Merge branch 'redwood' into releaseRELBASE_20201124RELBASE_20201120RC_20201120
Diffstat (limited to 'modules/brotli/enc/block_splitter.c')
-rw-r--r--modules/brotli/enc/block_splitter.c6
1 files changed, 3 insertions, 3 deletions
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) {