hdmirx: Coverity defect cleanup:hdmi rx [1/1]

PD#SWPL-15167

Problem:
Coverity defect cleanup:hdmi rx

Solution:
Modify code according to coverity

Verify:
verify on the board of x3011

Change-Id: If325bcd7ca3a7f85cd17ac8b57e4a15284231ccc
Signed-off-by: Zhengrong Zhu <zhengrong.zhu@amlogic.com>
This commit is contained in:
Zhengrong.Zhu
2019-11-01 15:07:45 +08:00
committed by Luke Go
parent 0d09990db9
commit cdd8ccd594
2 changed files with 5 additions and 8 deletions

View File

@@ -34,20 +34,20 @@
#include "hdmi_rx_edid.h"
#define RX_VER0 "ver.2019-10-09"
#define RX_VER0 "ver.2019/10/21"
/*
*
*
*
*
*/
#define RX_VER1 "ver.2019/10/21"
#define RX_VER1 "ver.2019/10/17"
/*
*
*
*
*/
#define RX_VER2 "ver.2019/10/17"
#define RX_VER2 "ver.2019/11/01"
/*print type*/
#define LOG_EN 0x01

View File

@@ -3439,7 +3439,8 @@ unsigned char *compose_audio_db(uint8_t *aud_db, uint8_t *add_buf)
/* copy ramin Short Audio Descriptors
* in add_buf, except blk header
*/
memcpy(com_aud+idx, tmp_buf+1, add_buf_len-1);
if (idx + add_buf_len - 1 <= sizeof(com_aud))
memcpy(com_aud + idx, tmp_buf + 1, add_buf_len - 1);
payload_len = (idx - 1) + (add_buf_len - 1);
/* data blk header */
com_aud[0] = (AUDIO_TAG << 5) | payload_len;
@@ -3586,10 +3587,6 @@ void splice_data_blk_to_edid(uint8_t *p_edid, uint8_t *add_buf,
free_size += (tag_db_len-add_db_len);
free_space_off = 255-free_size;
memset(&p_edid[free_space_off], 0, free_size);
} else if (add_db_len - tag_db_len > DB_LEN_MAX-1) {
/* data block is maxmium 32bytes, minimum 1byte */
rx_pr("illegal add data blk len: %d\n", add_db_len);
return;
} else if (add_db_len - tag_db_len <= free_size) {
/* move data behind current data
* block, except checksum