fix[hal_h265d]: Avoid risk of segment fault

Change-Id: I5af80d2de068cb6cb5ded11c110a86c35626bffb
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
This commit is contained in:
Johnson Ding
2024-08-09 18:03:04 +08:00
parent c2689ac98a
commit ad898220a6
4 changed files with 24 additions and 24 deletions

View File

@@ -991,18 +991,18 @@ MPP_RET hal_h265d_rkv_wait(void *hal, HalTaskInfo *task)
H265d_REGS_t *hw_regs = NULL;
RK_S32 i;
if (task->dec.flags.parse_err ||
task->dec.flags.ref_err) {
h265h_dbg(H265H_DBG_TASK_ERR, "%s found task error\n", __FUNCTION__);
goto ERR_PROC;
}
if (reg_ctx->fast_mode) {
hw_regs = ( H265d_REGS_t *)reg_ctx->g_buf[index].hw_regs;
} else {
hw_regs = ( H265d_REGS_t *)reg_ctx->hw_regs;
}
if (task->dec.flags.parse_err ||
task->dec.flags.ref_err) {
h265h_dbg(H265H_DBG_TASK_ERR, "%s found task error\n", __FUNCTION__);
goto ERR_PROC;
}
ret = mpp_dev_ioctl(reg_ctx->dev, MPP_DEV_CMD_POLL, NULL);
if (ret)
mpp_err_f("poll cmd failed %d\n", ret);

View File

@@ -1278,12 +1278,6 @@ static MPP_RET hal_h265d_vdpu34x_wait(void *hal, HalTaskInfo *task)
Vdpu34xH265dRegSet *hw_regs = NULL;
RK_S32 i;
if (task->dec.flags.parse_err ||
task->dec.flags.ref_err) {
h265h_dbg(H265H_DBG_TASK_ERR, "%s found task error\n", __FUNCTION__);
goto ERR_PROC;
}
if (reg_ctx->fast_mode) {
hw_regs = ( Vdpu34xH265dRegSet *)reg_ctx->g_buf[index].hw_regs;
} else {
@@ -1292,6 +1286,12 @@ static MPP_RET hal_h265d_vdpu34x_wait(void *hal, HalTaskInfo *task)
p = (RK_U8*)hw_regs;
if (task->dec.flags.parse_err ||
task->dec.flags.ref_err) {
h265h_dbg(H265H_DBG_TASK_ERR, "%s found task error\n", __FUNCTION__);
goto ERR_PROC;
}
ret = mpp_dev_ioctl(reg_ctx->dev, MPP_DEV_CMD_POLL, NULL);
if (ret)
mpp_err_f("poll cmd failed %d\n", ret);

View File

@@ -1082,12 +1082,6 @@ static MPP_RET hal_h265d_vdpu382_wait(void *hal, HalTaskInfo *task)
Vdpu382H265dRegSet *hw_regs = NULL;
RK_S32 i;
if (task->dec.flags.parse_err ||
task->dec.flags.ref_err) {
h265h_dbg(H265H_DBG_TASK_ERR, "%s found task error\n", __FUNCTION__);
goto ERR_PROC;
}
if (reg_ctx->fast_mode) {
hw_regs = ( Vdpu382H265dRegSet *)reg_ctx->g_buf[index].hw_regs;
} else {
@@ -1096,6 +1090,12 @@ static MPP_RET hal_h265d_vdpu382_wait(void *hal, HalTaskInfo *task)
p = (RK_U8*)hw_regs;
if (task->dec.flags.parse_err ||
task->dec.flags.ref_err) {
h265h_dbg(H265H_DBG_TASK_ERR, "%s found task error\n", __FUNCTION__);
goto ERR_PROC;
}
ret = mpp_dev_ioctl(reg_ctx->dev, MPP_DEV_CMD_POLL, NULL);
if (ret)
mpp_err_f("poll cmd failed %d\n", ret);

View File

@@ -1343,12 +1343,6 @@ static MPP_RET hal_h265d_vdpu383_wait(void *hal, HalTaskInfo *task)
Vdpu383H265dRegSet *hw_regs = NULL;
RK_S32 i;
if (task->dec.flags.parse_err ||
task->dec.flags.ref_err) {
h265h_dbg(H265H_DBG_TASK_ERR, "%s found task error\n", __FUNCTION__);
goto ERR_PROC;
}
if (reg_ctx->fast_mode) {
hw_regs = ( Vdpu383H265dRegSet *)reg_ctx->g_buf[index].hw_regs;
} else {
@@ -1357,6 +1351,12 @@ static MPP_RET hal_h265d_vdpu383_wait(void *hal, HalTaskInfo *task)
p = (RK_U8*)hw_regs;
if (task->dec.flags.parse_err ||
task->dec.flags.ref_err) {
h265h_dbg(H265H_DBG_TASK_ERR, "%s found task error\n", __FUNCTION__);
goto ERR_PROC;
}
ret = mpp_dev_ioctl(reg_ctx->dev, MPP_DEV_CMD_POLL, NULL);
if (ret)
mpp_err_f("poll cmd failed %d\n", ret);