Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions decoder/ih264d_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,7 @@ void ih264d_init_decoder(void * ps_dec_params)
memset(ps_dec->pv_mv_buf_mgr, 0, size);

/* Free any dynamic buffers that are allocated */
PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_bits_buf_dynamic);
ih264d_free_dynamic_bufs(ps_dec);

{
Expand Down Expand Up @@ -3649,6 +3650,7 @@ WORD32 ih264d_delete(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
ps_dec = (dec_struct_t *)(dec_hdl->pv_codec_handle);
UNUSED(ps_ip);
ps_op->s_ivd_delete_op_t.u4_error_code = 0;
PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_bits_buf_dynamic);
ih264d_free_dynamic_bufs(ps_dec);
ih264d_free_static_bufs(dec_hdl);
return IV_SUCCESS;
Expand Down
6 changes: 4 additions & 2 deletions decoder/ih264d_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1931,6 +1931,10 @@ WORD16 ih264d_allocate_dynamic_bufs(dec_struct_t * ps_dec)
UWORD32 u4_luma_size, u4_chroma_size;
void *pv_mem_ctxt = ps_dec->pv_mem_ctxt;

/* Free any dynamic buffers that are allocated earlier. As ps_dec is memset to zero */
/* at the beginning, it is safe to call this even if no memory was allocated earlier */
ih264d_free_dynamic_bufs(ps_dec);

size = u4_total_mbs;
pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
RETURN_IF((NULL == pv_buf), IV_FAIL);
Expand Down Expand Up @@ -2285,8 +2289,6 @@ WORD16 ih264d_allocate_dynamic_bufs(dec_struct_t * ps_dec)
*/
WORD16 ih264d_free_dynamic_bufs(dec_struct_t * ps_dec)
{
PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_bits_buf_dynamic);

PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_deblk_pic);
PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_dec_mb_map);
PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_recon_mb_map);
Expand Down
1 change: 1 addition & 0 deletions decoder/svc/isvcd_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ WORD16 isvcd_free_dynamic_bufs(svc_dec_lyr_struct_t *ps_svc_lyr_dec)
WORD32 i;
dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
/* Free any avc dynamic buffers that are allocated */
PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_bits_buf_dynamic);
ih264d_free_dynamic_bufs(ps_dec);
PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->pu1_crop_wnd_flag);
PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->ps_inter_lyr_mb_prms_base);
Expand Down
Loading