* [igt-dev] [PATCH i-g-t] lib/igt_edid: Allocate raw 8-bytes for VSDB
@ 2021-02-27 22:04 Khem Raj
2021-03-01 8:12 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib/igt_edid: Allocate raw 8-bytes for VSDB (rev2) Patchwork
0 siblings, 1 reply; 2+ messages in thread
From: Khem Raj @ 2021-02-27 22:04 UTC (permalink / raw)
To: igt-dev
hdmi_vsdb is an element of cea_vsdb which makes the size of cea_vsdb to
be 8 ( 3bytes ieee_oui ) + ( 5bytes hdmi_vsdb struct), its true that we
only use 7 bytes technically we can only allocate 7byte array but since
we are writing to elements of hdmi_vsdb struct which is sitting at offet
4-8 in cea_vsdb, compiler thinks we have an element which is out of
array bounds since out allocated size is 7bytes
This errors out
../git/lib/igt_edid.c:365:13: error: array subscript 'struct hdmi_vsdb[0]' is partly outside array bounds of 'char[7]' [-Werror=array-bounds]
365 | hdmi->src_phy_addr[0] = 0x10;
| ^~
allocating one extra byte matches with size of cea_vsdb and compiler is
happy
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
lib/igt_edid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/igt_edid.c b/lib/igt_edid.c
index 1c85486d..ce09cc47 100644
--- a/lib/igt_edid.c
+++ b/lib/igt_edid.c
@@ -351,7 +351,7 @@ void cea_sad_init_pcm(struct cea_sad *sad, int channels,
const struct cea_vsdb *cea_vsdb_get_hdmi_default(size_t *size)
{
/* We'll generate a VSDB with 2 extension fields. */
- static char raw[CEA_VSDB_HDMI_MIN_SIZE + 2] = {0};
+ static char raw[CEA_VSDB_HDMI_MIN_SIZE + 3] = {0};
struct cea_vsdb *vsdb;
struct hdmi_vsdb *hdmi;
--
2.30.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [igt-dev] ✗ Fi.CI.BAT: failure for lib/igt_edid: Allocate raw 8-bytes for VSDB (rev2)
2021-02-27 22:04 [igt-dev] [PATCH i-g-t] lib/igt_edid: Allocate raw 8-bytes for VSDB Khem Raj
@ 2021-03-01 8:12 ` Patchwork
0 siblings, 0 replies; 2+ messages in thread
From: Patchwork @ 2021-03-01 8:12 UTC (permalink / raw)
To: Khem Raj; +Cc: igt-dev
[-- Attachment #1.1: Type: text/plain, Size: 240 bytes --]
== Series Details ==
Series: lib/igt_edid: Allocate raw 8-bytes for VSDB (rev2)
URL : https://patchwork.freedesktop.org/series/87459/
State : failure
== Summary ==
Series 87459 revision 2 was fully merged or fully failed: no git log
[-- Attachment #1.2: Type: text/html, Size: 708 bytes --]
[-- Attachment #2: Type: text/plain, Size: 154 bytes --]
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-01 8:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-27 22:04 [igt-dev] [PATCH i-g-t] lib/igt_edid: Allocate raw 8-bytes for VSDB Khem Raj
2021-03-01 8:12 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib/igt_edid: Allocate raw 8-bytes for VSDB (rev2) Patchwork
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.