summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2016-08-18 04:13:42 -0300
committerRay Zhang <rayz@codeaurora.org>2017-05-25 11:22:08 +0800
commitffd4fa2c1c60f177b821447a99090a683bf0f9a6 (patch)
tree40d19d956249a0fdbc4eb1feeeaa96e720597b53
parent14af6dc68348b81dd6feea4044f47882feb1083c (diff)
[media] cec-edid: check for IEEE identifier
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. Change-Id: I4e8ea260ffd38846ec977a0a6c6b855afa2edeec Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Git-commit: 8ac6a1a53e9f195e8c4336a7edfba2e102fc14bb Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git Signed-off-by: Ray Zhang <rayz@codeaurora.org>
-rw-r--r--drivers/media/cec-edid.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/cec-edid.c b/drivers/media/cec-edid.c
index 70018247bdda..5719b991e340 100644
--- a/drivers/media/cec-edid.c
+++ b/drivers/media/cec-edid.c
@@ -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);