summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorHector Martin <marcan@marcan.st>2017-11-15 03:12:31 +0900
committerAdam Jackson <ajax@redhat.com>2017-12-13 10:07:17 -0500
commitd1a2a2757977bf2f241fd254be821bf96910b587 (patch)
treeb33803be4ed613bc99b6c7d7f3f8b8225b73790d /hw
parentb3fa60edc412e4c52bc6fa0346217eed0ebc98e3 (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> (cherry picked from commit 68556d74b49e99d3490166c446079f7d5de26ca4)
Diffstat (limited to 'hw')
-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 f0e1e974b..f903496f5 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -976,8 +976,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);
}
}