diff options
author | Alon Levy <alevy@redhat.com> | 2012-08-09 15:45:05 +0300 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2012-10-23 18:46:59 +0200 |
commit | b1367c05a1e12655dc162f684141a16101ad93ca (patch) | |
tree | 8eee6a1d91e1ea44e0947230c6215171d93a6388 | |
parent | efd741e9c68ae501ea2bbf2534e6d281194c7b84 (diff) |
qxl_driver: qxl_kms_push_helper: bail on bad reloc (debug)
-rw-r--r-- | src/qxl_driver.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/qxl_driver.c b/src/qxl_driver.c index ec32283..b9c392e 100644 --- a/src/qxl_driver.c +++ b/src/qxl_driver.c @@ -2713,6 +2713,17 @@ qxl_kms_push_helper(qxl_screen_t *qxl, void *cmd, uint32_t size, c.command_size = size - sizeof(union QXLReleaseInfo); c.command = (uint64_t)((uint8_t *)cmd + sizeof(union QXLReleaseInfo)); if (cmd_aux) { + // debug + int i; + for (i = 0 ; i < cmd_aux->relocs_num ; ++i) { + if (cmd_aux->relocs[i].src_handle > 30000 || + cmd_aux->relocs[i].dst_handle > 30000) { + fprintf(stderr, "%s: error: bad reloc %d: %d->%d\n", __func__, + i, cmd_aux->relocs[i].src_handle, + cmd_aux->relocs[i].dst_handle); + exit(-1); + } + } c.relocs_num = cmd_aux->relocs_num; c.relocs = (uint64_t)cmd_aux->relocs; } else { |