Commit d3dfcde0 authored by James Berry's avatar James Berry

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
parent 0ff10bb1
...@@ -262,6 +262,7 @@ static void setup_features(VP8_COMP *cpi) ...@@ -262,6 +262,7 @@ static void setup_features(VP8_COMP *cpi)
void vp8_dealloc_compressor_data(VP8_COMP *cpi) void vp8_dealloc_compressor_data(VP8_COMP *cpi)
{ {
if(cpi->tplist!=0)
vpx_free(cpi->tplist); vpx_free(cpi->tplist);
cpi->tplist = NULL; cpi->tplist = NULL;
...@@ -1406,6 +1407,9 @@ void vp8_alloc_compressor_data(VP8_COMP *cpi) ...@@ -1406,6 +1407,9 @@ void vp8_alloc_compressor_data(VP8_COMP *cpi)
cpi->mt_sync_range = 16; cpi->mt_sync_range = 16;
#endif #endif
if(cpi->tplist);
vpx_free(cpi->tplist);
CHECK_MEM_ERROR(cpi->tplist, vpx_malloc(sizeof(TOKENLIST) * cpi->common.mb_rows)); CHECK_MEM_ERROR(cpi->tplist, vpx_malloc(sizeof(TOKENLIST) * cpi->common.mb_rows));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment