diff --git a/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c b/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c index f7f9a205f9..14c8417d43 100644 --- a/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c +++ b/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c @@ -151,7 +151,7 @@ QemuLoadKernelImage ( // // Drop the terminating NUL, convert to UTF-16. // - KernelLoadedImage->LoadOptionsSize = (CommandLineSize - 1) * 2; + KernelLoadedImage->LoadOptionsSize = (UINT32)((CommandLineSize - 1) * 2); } QemuFwCfgSelectItem (QemuFwCfgItemInitrdSize);