Commits
Ye Li committed 95a2ad3e6e0
MLK-24010 video: imx: Fix build warning in HDP library Found below warning in API_AVI.c by using gcc 9.2 to build iMX8MQ EVK drivers/video/imx/hdmi/hdp/API_AVI.c: In function ‘cdn_api_set_avi’: drivers/video/imx/hdmi/hdp/API_AVI.c:184:8: warning: array subscript 16 is outside array bounds of ‘unsigned int[4]’ [-Warray-bounds] 184 | packet[16] = packet_pb12; | ~~~~~~^~~~ drivers/video/imx/hdmi/hdp/API_AVI.c:74:15: note: while referencing ‘packet_buf’ 74 | unsigned int packet_buf[18 / sizeof(unsigned int)]; | ^~~~~~~~~~ drivers/video/imx/hdmi/hdp/API_AVI.c:185:8: warning: array subscript 17 is outside array bounds of ‘unsigned int[4]’ [-Warray-bounds] 185 | packet[17] = packet_pb13; | ~~~~~~^~~~ drivers/video/imx/hdmi/hdp/API_AVI.c:74:15: note: while referencing ‘packet_buf’ 74 | unsigned int packet_buf[18 / sizeof(unsigned int)]; | ^~~~~~~~~~ There are two array overflow issues in the codes: 1. The packet array size is not correct. The total buf needs 18 bytes, but the array size is only 4 words (16 bytes). 2. When passing the packet array to cdn_api_infoframeset, the size should be words size, but it uses a wrong packet length which is calculated in bytes Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> (cherry picked from commit 287a4b7816a34e41f3ca7dd12b3e99aa46bed71e)