Fix ubsan warning.

This commit is contained in:
Eugene Kliuchnikov 2016-07-27 11:02:27 +02:00
parent 8b7e3c7ba5
commit e0af054d9e

View File

@ -157,7 +157,7 @@ _TEMPLATE(size_t) _TEMPLATE(uint32_t) _TEMPLATE(uint8_t)
T* new_array; \
while (_new_size < (R)) _new_size *= 2; \
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)); \
BROTLI_FREE((M), A); \
A = new_array; \