From 889cd827aefb1ae49b2db6f4f2b1ee751653a64c Mon Sep 17 00:00:00 2001 From: Jonathon Jongsma Date: Thu, 14 Nov 2019 15:59:17 -0600 Subject: [PATCH] conf: validate video resolution Ensure that both x and y are non-zero when resolution is specified for a video device. Reviewed-by: Cole Robinson Signed-off-by: Jonathon Jongsma --- src/conf/domain_conf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c0f20c928f..54d6ae297e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6319,6 +6319,12 @@ virDomainVideoDefValidate(const virDomainVideoDef *video, return -1; } + if (video->res && (video->res->x == 0 || video->res->y == 0)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("video resolution values must be greater than 0")); + return -1; + } + return 0; }