ref: d3dfcde0f7e499113ae7cdbb85c9b6306b2d7e24
parent: 0ff10bb1f7ece4300350243c5d01da2eb1d198b6
author: James Berry <jamesberry@google.com>
date: Mon Feb 14 09:02:52 EST 2011
mem leak fix for cpi->tplist checks added to make sure that cpi->tplist is freed correctly in vp8_dealloc_compressor_data and vp8_alloc_compressor_data. Change-Id: I66149dbbd25c958800ad94f4379d723191d9680d
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -262,7 +262,8 @@
void vp8_dealloc_compressor_data(VP8_COMP *cpi)
{
- vpx_free(cpi->tplist);
+ if(cpi->tplist!=0)
+ vpx_free(cpi->tplist);
cpi->tplist = NULL;
// Delete last frame MV storage buffers
@@ -1405,6 +1406,9 @@
else
cpi->mt_sync_range = 16;
#endif
+
+ if(cpi->tplist);
+ vpx_free(cpi->tplist);
CHECK_MEM_ERROR(cpi->tplist, vpx_malloc(sizeof(TOKENLIST) * cpi->common.mb_rows));
}