mirror of
https://github.com/google/brotli.git
synced 2024-12-28 02:31:05 +00:00
Fix ubsan warning.
This commit is contained in:
parent
8b7e3c7ba5
commit
e0af054d9e
@ -157,7 +157,7 @@ _TEMPLATE(size_t) _TEMPLATE(uint32_t) _TEMPLATE(uint8_t)
|
|||||||
T* new_array; \
|
T* new_array; \
|
||||||
while (_new_size < (R)) _new_size *= 2; \
|
while (_new_size < (R)) _new_size *= 2; \
|
||||||
new_array = BROTLI_ALLOC((M), T, _new_size); \
|
new_array = BROTLI_ALLOC((M), T, _new_size); \
|
||||||
if (!BROTLI_IS_OOM(m)) \
|
if (!BROTLI_IS_OOM(m) && C != 0) \
|
||||||
memcpy(new_array, A, C * sizeof(T)); \
|
memcpy(new_array, A, C * sizeof(T)); \
|
||||||
BROTLI_FREE((M), A); \
|
BROTLI_FREE((M), A); \
|
||||||
A = new_array; \
|
A = new_array; \
|
||||||
|
Loading…
Reference in New Issue
Block a user