summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzbierak <zbierak@users.noreply.github.com>2016-04-04 19:01:02 +0200
committerzbierak <zbierak@users.noreply.github.com>2016-04-04 19:01:02 +0200
commit00105c3ac58802685722b608505d741265ce29a2 (patch)
tree58e43508f484e39d542e68b5a99969885762c004
parent5b322f523faa437d8e7d03736bdb1714e8f84ce5 (diff)
downloadlibtdevnc-00105c3a.tar.gz
libtdevnc-00105c3a.zip
Fix memory access error in camera.c example
-rw-r--r--examples/camera.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/camera.c b/examples/camera.c
index 2e54da7..51b122d 100644
--- a/examples/camera.c
+++ b/examples/camera.c
@@ -104,7 +104,7 @@ int TakePicture(unsigned char *buffer)
*/
gettimeofday(&now,NULL);
line = now.tv_usec / (1000000/HEIGHT);
- if (line>HEIGHT) line=HEIGHT-1;
+ if (line>=HEIGHT) line=HEIGHT-1;
memset(&buffer[(WIDTH * BPP) * line], 0, (WIDTH * BPP));
/* frames per second (informational only) */