mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-08 18:40:03 +08:00
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:
@@ -991,18 +991,18 @@ MPP_RET hal_h265d_rkv_wait(void *hal, HalTaskInfo *task)
|
|||||||
H265d_REGS_t *hw_regs = NULL;
|
H265d_REGS_t *hw_regs = NULL;
|
||||||
RK_S32 i;
|
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) {
|
if (reg_ctx->fast_mode) {
|
||||||
hw_regs = ( H265d_REGS_t *)reg_ctx->g_buf[index].hw_regs;
|
hw_regs = ( H265d_REGS_t *)reg_ctx->g_buf[index].hw_regs;
|
||||||
} else {
|
} else {
|
||||||
hw_regs = ( H265d_REGS_t *)reg_ctx->hw_regs;
|
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);
|
ret = mpp_dev_ioctl(reg_ctx->dev, MPP_DEV_CMD_POLL, NULL);
|
||||||
if (ret)
|
if (ret)
|
||||||
mpp_err_f("poll cmd failed %d\n", ret);
|
mpp_err_f("poll cmd failed %d\n", ret);
|
||||||
|
@@ -1278,12 +1278,6 @@ static MPP_RET hal_h265d_vdpu34x_wait(void *hal, HalTaskInfo *task)
|
|||||||
Vdpu34xH265dRegSet *hw_regs = NULL;
|
Vdpu34xH265dRegSet *hw_regs = NULL;
|
||||||
RK_S32 i;
|
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) {
|
if (reg_ctx->fast_mode) {
|
||||||
hw_regs = ( Vdpu34xH265dRegSet *)reg_ctx->g_buf[index].hw_regs;
|
hw_regs = ( Vdpu34xH265dRegSet *)reg_ctx->g_buf[index].hw_regs;
|
||||||
} else {
|
} else {
|
||||||
@@ -1292,6 +1286,12 @@ static MPP_RET hal_h265d_vdpu34x_wait(void *hal, HalTaskInfo *task)
|
|||||||
|
|
||||||
p = (RK_U8*)hw_regs;
|
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);
|
ret = mpp_dev_ioctl(reg_ctx->dev, MPP_DEV_CMD_POLL, NULL);
|
||||||
if (ret)
|
if (ret)
|
||||||
mpp_err_f("poll cmd failed %d\n", ret);
|
mpp_err_f("poll cmd failed %d\n", ret);
|
||||||
|
@@ -1082,12 +1082,6 @@ static MPP_RET hal_h265d_vdpu382_wait(void *hal, HalTaskInfo *task)
|
|||||||
Vdpu382H265dRegSet *hw_regs = NULL;
|
Vdpu382H265dRegSet *hw_regs = NULL;
|
||||||
RK_S32 i;
|
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) {
|
if (reg_ctx->fast_mode) {
|
||||||
hw_regs = ( Vdpu382H265dRegSet *)reg_ctx->g_buf[index].hw_regs;
|
hw_regs = ( Vdpu382H265dRegSet *)reg_ctx->g_buf[index].hw_regs;
|
||||||
} else {
|
} else {
|
||||||
@@ -1096,6 +1090,12 @@ static MPP_RET hal_h265d_vdpu382_wait(void *hal, HalTaskInfo *task)
|
|||||||
|
|
||||||
p = (RK_U8*)hw_regs;
|
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);
|
ret = mpp_dev_ioctl(reg_ctx->dev, MPP_DEV_CMD_POLL, NULL);
|
||||||
if (ret)
|
if (ret)
|
||||||
mpp_err_f("poll cmd failed %d\n", ret);
|
mpp_err_f("poll cmd failed %d\n", ret);
|
||||||
|
@@ -1343,12 +1343,6 @@ static MPP_RET hal_h265d_vdpu383_wait(void *hal, HalTaskInfo *task)
|
|||||||
Vdpu383H265dRegSet *hw_regs = NULL;
|
Vdpu383H265dRegSet *hw_regs = NULL;
|
||||||
RK_S32 i;
|
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) {
|
if (reg_ctx->fast_mode) {
|
||||||
hw_regs = ( Vdpu383H265dRegSet *)reg_ctx->g_buf[index].hw_regs;
|
hw_regs = ( Vdpu383H265dRegSet *)reg_ctx->g_buf[index].hw_regs;
|
||||||
} else {
|
} else {
|
||||||
@@ -1357,6 +1351,12 @@ static MPP_RET hal_h265d_vdpu383_wait(void *hal, HalTaskInfo *task)
|
|||||||
|
|
||||||
p = (RK_U8*)hw_regs;
|
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);
|
ret = mpp_dev_ioctl(reg_ctx->dev, MPP_DEV_CMD_POLL, NULL);
|
||||||
if (ret)
|
if (ret)
|
||||||
mpp_err_f("poll cmd failed %d\n", ret);
|
mpp_err_f("poll cmd failed %d\n", ret);
|
||||||
|
Reference in New Issue
Block a user