Another nullptr-arithmetics clamer

PiperOrigin-RevId: 721741817
This commit is contained in:
Evgenii Kliuchnikov 2025-01-31 05:42:35 -08:00 committed by Copybara-Service
parent a1e3ab25ce
commit 440e03642b
1 changed files with 9 additions and 5 deletions

View File

@ -230,12 +230,16 @@ static void FN(ClusterBlocks)(MemoryManager* m,
static const uint32_t kInvalidIndex = BROTLI_UINT32_MAX;
uint32_t* new_index;
size_t i;
uint32_t* BROTLI_RESTRICT const sizes = u32 + 0 * HISTOGRAMS_PER_BATCH;
uint32_t* BROTLI_RESTRICT const new_clusters = u32 + 1 * HISTOGRAMS_PER_BATCH;
uint32_t* BROTLI_RESTRICT const symbols = u32 + 2 * HISTOGRAMS_PER_BATCH;
uint32_t* BROTLI_RESTRICT const remap = u32 + 3 * HISTOGRAMS_PER_BATCH;
uint32_t* BROTLI_RESTRICT const sizes =
u32 ? (u32 + 0 * HISTOGRAMS_PER_BATCH) : NULL;
uint32_t* BROTLI_RESTRICT const new_clusters =
u32 ? (u32 + 1 * HISTOGRAMS_PER_BATCH) : NULL;
uint32_t* BROTLI_RESTRICT const symbols =
u32 ? (u32 + 2 * HISTOGRAMS_PER_BATCH) : NULL;
uint32_t* BROTLI_RESTRICT const remap =
u32 ? (u32 + 3 * HISTOGRAMS_PER_BATCH) : NULL;
uint32_t* BROTLI_RESTRICT const block_lengths =
u32 + 4 * HISTOGRAMS_PER_BATCH;
u32 ? (u32 + 4 * HISTOGRAMS_PER_BATCH) : NULL;
/* TODO(eustas): move to arena? */
HistogramType* tmp = BROTLI_ALLOC(m, HistogramType, 2);