mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-12 04:20:03 +08:00
[legacy]: Fix vpu_api_test memory leak issue
Data in DecoderOut_t is malloc from vpu_api_legacy. And Android OMX component is following this rule for historical reason. We have to change test case to support it. Change-Id: I202525eecc461bd9507cfa2c376de11e2fc6fc9b Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
@@ -563,12 +563,6 @@ static RK_S32 vpu_decode_demo(VpuApiDemoCmdContext_t *cmd)
|
|||||||
memset(&decOut, 0, sizeof(DecoderOut_t));
|
memset(&decOut, 0, sizeof(DecoderOut_t));
|
||||||
pOut = &decOut;
|
pOut = &decOut;
|
||||||
|
|
||||||
pOut->data = (RK_U8 *)(malloc)(sizeof(VPU_FRAME));
|
|
||||||
if (pOut->data == NULL) {
|
|
||||||
DECODE_ERR_RET(ERROR_MEMORY);
|
|
||||||
}
|
|
||||||
memset(pOut->data, 0, sizeof(VPU_FRAME));
|
|
||||||
|
|
||||||
ret = vpu_open_context(&ctx);
|
ret = vpu_open_context(&ctx);
|
||||||
if (ret || (ctx == NULL)) {
|
if (ret || (ctx == NULL)) {
|
||||||
DECODE_ERR_RET(ERROR_MEMORY);
|
DECODE_ERR_RET(ERROR_MEMORY);
|
||||||
@@ -693,6 +687,9 @@ static RK_S32 vpu_decode_demo(VpuApiDemoCmdContext_t *cmd)
|
|||||||
** give you a surprise.
|
** give you a surprise.
|
||||||
*/
|
*/
|
||||||
VPUFreeLinear(&frame->vpumem);
|
VPUFreeLinear(&frame->vpumem);
|
||||||
|
// NOTE: pOut->data is malloc from vpu_api we need to free it.
|
||||||
|
free(pOut->data);
|
||||||
|
pOut->data = NULL;
|
||||||
pOut->size = 0;
|
pOut->size = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user