MLK-22668 VPU Decoder: correct frame_byte typedef to int
authorShijie Qin <shijie.qin@nxp.com>
Wed, 25 Sep 2019 09:10:18 +0000 (17:10 +0800)
committerShijie Qin <shijie.qin@nxp.com>
Thu, 24 Oct 2019 10:56:31 +0000 (18:56 +0800)
Correct frame_byte typedef to int in order to align with
update_stream_addr_vpu() typedef, it maybe negative.

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
(cherry picked from commit b04249f00b7cb28a17d3b7b992d565ca0edbee28)

drivers/mxc/vpu_malone/insert_startcode.c
drivers/mxc/vpu_malone/vpu_b0.c

index 8911585..e8c3ea9 100644 (file)
@@ -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)) {
index a66dfbc..9e17a8f 100644 (file)
@@ -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;