av1_alloc_txb_buf: add missing alloc checks
Bug: aomedia:3276
Change-Id: Ia2e1c6e596b2ad8ccf158fd8d07fa95488644654
diff --git a/av1/encoder/encodetxb.c b/av1/encoder/encodetxb.c
index c059366..4ea4f4c 100644
--- a/av1/encoder/encodetxb.c
+++ b/av1/encoder/encodetxb.c
@@ -44,14 +44,17 @@
av1_free_txb_buf(cpi);
// TODO(jingning): This should be further reduced.
- cpi->coeff_buffer_base = aom_malloc(sizeof(*cpi->coeff_buffer_base) * size);
+ CHECK_MEM_ERROR(cm, cpi->coeff_buffer_base,
+ aom_malloc(sizeof(*cpi->coeff_buffer_base) * size));
CHECK_MEM_ERROR(
cm, coeff_buf_pool->tcoeff,
aom_memalign(32, sizeof(*coeff_buf_pool->tcoeff) * num_tcoeffs));
- coeff_buf_pool->eobs =
- aom_malloc(sizeof(*coeff_buf_pool->eobs) * num_tcoeffs / txb_unit_size);
- coeff_buf_pool->entropy_ctx = aom_malloc(
- sizeof(*coeff_buf_pool->entropy_ctx) * num_tcoeffs / txb_unit_size);
+ CHECK_MEM_ERROR(
+ cm, coeff_buf_pool->eobs,
+ aom_malloc(sizeof(*coeff_buf_pool->eobs) * num_tcoeffs / txb_unit_size));
+ CHECK_MEM_ERROR(cm, coeff_buf_pool->entropy_ctx,
+ aom_malloc(sizeof(*coeff_buf_pool->entropy_ctx) *
+ num_tcoeffs / txb_unit_size));
tran_low_t *tcoeff_ptr = coeff_buf_pool->tcoeff;
uint16_t *eob_ptr = coeff_buf_pool->eobs;