Skip to content

Commit

Permalink
Fix (speculative) nullptr arithmetic
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 721739274
  • Loading branch information
eustas authored and copybara-github committed Jan 31, 2025
1 parent 28b1183 commit a1e3ab2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion c/dec/state.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ BROTLI_BOOL BrotliDecoderHuffmanTreeGroupInit(BrotliDecoderState* s,
group->alphabet_size_limit = (uint16_t)alphabet_size_limit;
group->num_htrees = (uint16_t)ntrees;
group->htrees = p;
group->codes = (HuffmanCode*)(&p[ntrees]);
group->codes = p ? (HuffmanCode*)(&p[ntrees]) : NULL;
return !!p;
}

Expand Down

0 comments on commit a1e3ab2

Please sign in to comment.