HorizontalResolution and VerticalResolution are 32bit, while size is
64bit. As it stands multiplications are evaluated with 32bit arithmetic,
which could overflow. Cast HorizontalResolution to 64bit to avoid that.
Coverity-ID:
1381858
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
break;
}
if ( !cols && !rows &&
- mode_info->HorizontalResolution *
+ (UINTN)mode_info->HorizontalResolution *
mode_info->VerticalResolution > size )
{
- size = mode_info->HorizontalResolution *
+ size = (UINTN)mode_info->HorizontalResolution *
mode_info->VerticalResolution;
gop_mode = i;
}