diff options
author | Moonchild <moonchild@palemoon.org> | 2020-11-20 09:47:03 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-11-20 09:47:03 +0000 |
commit | 5165ed02285315cc0bed7977c7bac6d0a90ca43c (patch) | |
tree | 9b761a21eb924915e51c2d803208e6c01b505a45 /modules/brotli/enc/cluster_inc.h | |
parent | e1db27e19989db11fef70f439cf95821316535b3 (diff) | |
parent | ca9abcdf1702c37bf00048dab3f460b2252873a3 (diff) | |
download | UXP-RELBASE_20201120.tar UXP-RELBASE_20201120.tar.gz UXP-RELBASE_20201120.tar.lz UXP-RELBASE_20201120.tar.xz UXP-RELBASE_20201120.zip |
Merge branch 'redwood' into releaseRELBASE_20201124RELBASE_20201120RC_20201120
Diffstat (limited to 'modules/brotli/enc/cluster_inc.h')
-rw-r--r-- | modules/brotli/enc/cluster_inc.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/brotli/enc/cluster_inc.h b/modules/brotli/enc/cluster_inc.h index 22ecb3cca..3d4f40e60 100644 --- a/modules/brotli/enc/cluster_inc.h +++ b/modules/brotli/enc/cluster_inc.h @@ -215,7 +215,7 @@ BROTLI_INTERNAL size_t FN(BrotliHistogramReindex)(MemoryManager* m, uint32_t next_index; HistogramType* tmp; size_t i; - if (BROTLI_IS_OOM(m)) return 0; + if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(new_index)) return 0; for (i = 0; i < length; ++i) { new_index[i] = kInvalidIndex; } @@ -229,7 +229,7 @@ BROTLI_INTERNAL size_t FN(BrotliHistogramReindex)(MemoryManager* m, /* TODO: by using idea of "cycle-sort" we can avoid allocation of tmp and reduce the number of copying by the factor of 2. */ tmp = BROTLI_ALLOC(m, HistogramType, next_index); - if (BROTLI_IS_OOM(m)) return 0; + if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(tmp)) return 0; next_index = 0; for (i = 0; i < length; ++i) { if (new_index[symbols[i]] == next_index) { @@ -259,7 +259,10 @@ BROTLI_INTERNAL void FN(BrotliClusterHistograms)( HistogramPair* pairs = BROTLI_ALLOC(m, HistogramPair, pairs_capacity + 1); size_t i; - if (BROTLI_IS_OOM(m)) return; + if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(cluster_size) || + BROTLI_IS_NULL(clusters) || BROTLI_IS_NULL(pairs)) { + return; + } for (i = 0; i < in_size; ++i) { cluster_size[i] = 1; |