ui/console: fix OVERFLOW_BEFORE_WIDEN

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gonglei 2015-03-11 16:21:00 +08:00 committed by Gerd Hoffmann
parent 8c7d064573
commit f76b84a04b
1 changed files with 2 additions and 2 deletions

View File

@ -1285,9 +1285,9 @@ DisplaySurface *qemu_create_displaysurface_guestmem(int width, int height,
linesize = width * PIXMAN_FORMAT_BPP(format) / 8;
}
size = linesize * height;
size = (hwaddr)linesize * height;
data = cpu_physical_memory_map(addr, &size, 0);
if (size != linesize * height) {
if (size != (hwaddr)linesize * height) {
cpu_physical_memory_unmap(data, size, 0, 0);
return NULL;
}