summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHector Martin <marcan@marcan.st>2017-11-15 03:12:31 +0900
committerAdam Jackson <ajax@redhat.com>2017-11-14 15:52:25 -0500
commit68556d74b49e99d3490166c446079f7d5de26ca4 (patch)
treeec5fe1ba2bd36d9be0d30aa961fe99c1fe2d0adf
parent9bd5a198dc5383d0d2a1e28f7aa4270132eca5db (diff)
edid: fix off-by-one error in CEA mode numbering
The CEA extension short video descriptors contain the VIC, which starts at 1, not 0. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Hector Martin <marcan@marcan.st>
-rw-r--r--hw/xfree86/modes/xf86EdidModes.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index 908c5a4cf..ff04eca03 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -970,8 +970,8 @@ handle_cea_svd(struct cea_video_block *video, void *data)
int vid;
vid = video->video_code & 0x7f;
- if (vid < CEA_VIDEO_MODES_NUM) {
- Mode = xf86DuplicateMode(CEAVideoModes + vid);
+ if (vid >= 1 && vid <= CEA_VIDEO_MODES_NUM) {
+ Mode = xf86DuplicateMode(CEAVideoModes + (vid - 1));
*Modes = xf86ModesAdd(*Modes, Mode);
}
}