From 7f1bf51bdbcaf9dd46f77cf4bd5e69a294dd995e Mon Sep 17 00:00:00 2001 From: Dandan Bi Date: Thu, 22 Sep 2016 09:21:38 +0800 Subject: OvmfPkg/VirtioGpuDxe: Fix VS toolchain build failure V2: add the assert codes. Cc: Jordan Justen Cc: Laszlo Ersek Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi Reviewed-by: Laszlo Ersek [lersek@redhat.com: fix up subject line] Signed-off-by: Laszlo Ersek --- OvmfPkg/VirtioGpuDxe/Commands.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/VirtioGpuDxe/Commands.c b/OvmfPkg/VirtioGpuDxe/Commands.c index b369dc3a7a..962087cfec 100644 --- a/OvmfPkg/VirtioGpuDxe/Commands.c +++ b/OvmfPkg/VirtioGpuDxe/Commands.c @@ -284,12 +284,13 @@ VirtioGpuSendCommand ( Header->Padding = 0; ASSERT (RequestSize >= sizeof *Header); + ASSERT (RequestSize <= MAX_UINT32); // // Compose the descriptor chain. // VirtioPrepare (&VgpuDev->Ring, &Indices); - VirtioAppendDesc (&VgpuDev->Ring, (UINTN)Header, RequestSize, + VirtioAppendDesc (&VgpuDev->Ring, (UINTN)Header, (UINT32)RequestSize, VRING_DESC_F_NEXT, &Indices); VirtioAppendDesc (&VgpuDev->Ring, (UINTN)&Response, sizeof Response, VRING_DESC_F_WRITE, &Indices); -- cgit v1.2.3