提交 36a03e0b 编写于 作者: M Michael Tokarev 提交者: Gerd Hoffmann

qxl/update_area_io: cleanup invalid parameters handling

This cleans up two additions of almost the same code in commits
511b13e2 and ccc2960d.  While at it, make error paths
consistent (always use 'break' instead of 'return').
Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
Cc: Dunrong Huang <riegamaths@gmail.com>
Cc: Alon Levy <alevy@redhat.com>
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 0ec8df39
......@@ -1547,20 +1547,13 @@ async_common:
if (d->ram->update_surface > d->ssd.num_surfaces) {
qxl_set_guest_bug(d, "QXL_IO_UPDATE_AREA: invalid surface id %d\n",
d->ram->update_surface);
return;
break;
}
if (update.left >= update.right || update.top >= update.bottom) {
if (update.left >= update.right || update.top >= update.bottom ||
update.left < 0 || update.top < 0) {
qxl_set_guest_bug(d,
"QXL_IO_UPDATE_AREA: invalid area (%ux%u)x(%ux%u)\n",
update.left, update.top, update.right, update.bottom);
return;
}
if (update.left < 0 || update.top < 0 || update.left >= update.right ||
update.top >= update.bottom) {
qxl_set_guest_bug(d, "QXL_IO_UPDATE_AREA: "
"invalid area(%d,%d,%d,%d)\n", update.left,
update.right, update.top, update.bottom);
break;
}
if (async == QXL_ASYNC) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册