Another nullptr-arithmetics clamer PiperOrigin-RevId: 721727118
diff --git a/c/enc/block_splitter_inc.h b/c/enc/block_splitter_inc.h index 64409ec..f7c4345 100644 --- a/c/enc/block_splitter_inc.h +++ b/c/enc/block_splitter_inc.h
@@ -230,12 +230,16 @@ 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);