From: Shijie Qin Date: Wed, 25 Sep 2019 09:10:18 +0000 (+0800) Subject: MLK-22668 VPU Decoder: correct frame_byte typedef to int X-Git-Tag: rel_imx_4.19.35_1.1.0~14 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=a374f6fe889c1e4e657b5a293c51e3cb1a21bd6b;p=linux.git MLK-22668 VPU Decoder: correct frame_byte typedef to int Correct frame_byte typedef to int in order to align with update_stream_addr_vpu() typedef, it maybe negative. Signed-off-by: Shijie Qin Reviewed-by: ming_qian (cherry picked from commit b04249f00b7cb28a17d3b7b992d565ca0edbee28) --- diff --git a/drivers/mxc/vpu_malone/insert_startcode.c b/drivers/mxc/vpu_malone/insert_startcode.c index 8911585953dc..e8c3ea9f3240 100644 --- a/drivers/mxc/vpu_malone/insert_startcode.c +++ b/drivers/mxc/vpu_malone/insert_startcode.c @@ -744,8 +744,11 @@ struct VPU_FMT_INFO_ARV *get_arv_info(struct vpu_ctx *ctx, u_int8 *src, u_int32 arv_frame->data_len = ((src[0] << 24) | (src[1] << 16) | (src[2] << 8) | (src[3])); arv_frame->slice_num = ((src[16] << 24) | (src[17] << 16) | (src[18] << 8) | (src[19])); - if (arv_frame->data_len > size || arv_frame->slice_num > size) + if (arv_frame->data_len > size || arv_frame->slice_num > size) { + vpu_dbg(LVL_WARN, "arv frame info incorrect, data_len=%d slice_num=%d buffer_size=%d\n", + arv_frame->data_len, arv_frame->slice_num, size); goto err; + } arv_frame->slice_offset = kcalloc(arv_frame->slice_num, sizeof(u_int32), GFP_KERNEL); if (IS_ERR_OR_NULL(arv_frame->slice_offset)) { diff --git a/drivers/mxc/vpu_malone/vpu_b0.c b/drivers/mxc/vpu_malone/vpu_b0.c index a66dfbc49131..9e17a8f6a646 100644 --- a/drivers/mxc/vpu_malone/vpu_b0.c +++ b/drivers/mxc/vpu_malone/vpu_b0.c @@ -3440,7 +3440,7 @@ static void enqueue_stream_data(struct vpu_ctx *ctx, uint32_t uStrBufIdx) struct queue_data *This = &ctx->q_data[V4L2_SRC]; void *input_buffer; uint32_t buffer_size; - u32 frame_bytes; + int frame_bytes; while (!list_empty(&This->drv_q)) { struct vb2_buffer *vb;