diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2014-10-01 08:05:54 -0400 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2014-10-01 08:05:54 -0400 |
commit | 6498ccddb2f13a6fac6a210372b1aa86873507b9 (patch) | |
tree | d8fa5ac5e99c01df46d71c3c87e87d2114bfe088 /src/base/vnc | |
parent | b520223699f51562140b8cc4a922eae64dffb3e3 (diff) | |
download | gem5-6498ccddb2f13a6fac6a210372b1aa86873507b9.tar.xz |
misc: Fix issues identified by static analysis
Another bunch of issues addressed.
Diffstat (limited to 'src/base/vnc')
-rw-r--r-- | src/base/vnc/vncserver.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/base/vnc/vncserver.cc b/src/base/vnc/vncserver.cc index e762ad1d4..77a4316ab 100644 --- a/src/base/vnc/vncserver.cc +++ b/src/base/vnc/vncserver.cc @@ -184,6 +184,8 @@ VncServer::accept() panic("%s: cannot accept a connection if not listening!", name()); int fd = listener.accept(true); + fatal_if(fd < 0, "%s: failed to accept VNC connection!", name()); + if (dataFd != -1) { char message[] = "vnc server already attached!\n"; atomic_write(fd, message, sizeof(message)); @@ -643,7 +645,8 @@ VncServer::sendFrameBufferUpdate() assert(fbPtr); uint8_t *tmp = vc->convert(fbPtr); - write(tmp, videoWidth() * videoHeight() * sizeof(uint32_t)); + uint64_t num_pixels = videoWidth() * videoHeight(); + write(tmp, num_pixels * sizeof(uint32_t)); delete [] tmp; } |