summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}
}