Commit f6214b96 authored by Jingning Han's avatar Jingning Han

Properly release the memory space in encode_frame_to_data_rate()

Explicitly release the locally allocated memory space in
encode_frame_to_data_rate(). This resolves an memory space leak
issue.

BUG=aomedia:431

Change-Id: I46f4b38b46ed951d42c622e88ce00afc566e7eae
parent d2f12ba5
......@@ -4775,6 +4775,10 @@ static void encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size,
++cm->current_video_frame;
#if CONFIG_EC_ADAPT
aom_free(tile_ctxs);
aom_free(cdf_ptrs);
#endif
return;
}
#endif // CONFIG_EXT_REFS
......@@ -4824,6 +4828,10 @@ static void encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size,
if (drop_this_frame) {
av1_rc_postencode_update_drop_frame(cpi);
++cm->current_video_frame;
#if CONFIG_EC_ADAPT
aom_free(tile_ctxs);
aom_free(cdf_ptrs);
#endif
return;
}
#else
......@@ -4834,6 +4842,10 @@ static void encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size,
if (av1_rc_drop_frame(cpi)) {
av1_rc_postencode_update_drop_frame(cpi);
++cm->current_video_frame;
#if CONFIG_EC_ADAPT
aom_free(tile_ctxs);
aom_free(cdf_ptrs);
#endif
return;
}
}
......@@ -4924,7 +4936,13 @@ static void encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size,
// Build the bitstream
av1_pack_bitstream(cpi, dest, size);
if (skip_adapt) return;
if (skip_adapt) {
#if CONFIG_EC_ADAPT
aom_free(tile_ctxs);
aom_free(cdf_ptrs);
#endif
return;
}
#if CONFIG_REFERENCE_BUFFER
{
......@@ -5024,6 +5042,10 @@ static void encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size,
if (drop_this_frame) {
av1_rc_postencode_update_drop_frame(cpi);
++cm->current_video_frame;
#if CONFIG_EC_ADAPT
aom_free(tile_ctxs);
aom_free(cdf_ptrs);
#endif
return;
}
#else
......
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