Fix memory access error in camera.c example

pull/1/head
zbierak 9 years ago
parent 5b322f523f
commit 00105c3ac5

@ -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) */

Loading…
Cancel
Save