]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
[media] cec-edid: check for IEEE identifier
authorHans Verkuil <hverkuil@xs4all.nl>
Thu, 18 Aug 2016 07:13:42 +0000 (04:13 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 22 Aug 2016 17:04:51 +0000 (14:04 -0300)
The cec_get_edid_spa_location() function did not verify that the IEEE
identifier in the Vendor Specific Data Block matched the HDMI-LLC
identifier. This could result in the wrong VSDB block being returned.

For example, for HDMI 2.0 EDIDs there is also a HDMI Forum VSDB.

So check the IEEE identifier as well.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/cec-edid.c

index 70018247bdda9ec9bc90a22e48713c27d47ff24b..5719b991e340d3df77cdbbedee48e36c67463273 100644 (file)
@@ -70,7 +70,10 @@ static unsigned int cec_get_edid_spa_location(const u8 *edid, unsigned int size)
                                u8 tag = edid[i] >> 5;
                                u8 len = edid[i] & 0x1f;
 
-                               if (tag == 3 && len >= 5 && i + len <= end)
+                               if (tag == 3 && len >= 5 && i + len <= end &&
+                                   edid[i + 1] == 0x03 &&
+                                   edid[i + 2] == 0x0c &&
+                                   edid[i + 3] == 0x00)
                                        return i + 4;
                                i += len + 1;
                        } while (i < end);