summaryrefslogtreecommitdiff
path: root/app/video
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2016-06-06 19:31:23 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2016-06-06 19:31:23 +0000
commit70e8187d0fba0391190a31497eaf188f78387caf (patch)
tree2826eba248abeb602f3a34894611dbfb84c7b732 /app/video
parent2a198b626205c493a488a0191111b020cb7926a8 (diff)
Comparing maximum frame buffer size after VIDIOC_DQBUF ioctl against
'buf.bytesused' instead of 'buf.length' makes more sense. From Patrick Keshish
Diffstat (limited to 'app/video')
-rw-r--r--app/video/video.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/video/video.c b/app/video/video.c
index c90c3d073..1b0745c32 100644
--- a/app/video/video.c
+++ b/app/video/video.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: video.c,v 1.18 2016/06/06 11:55:38 mglocker Exp $ */
+/* $OpenBSD: video.c,v 1.19 2016/06/06 19:31:22 mglocker Exp $ */
/*
* Copyright (c) 2010 Jacob Meuser <jakemsr@openbsd.org>
*
@@ -1455,9 +1455,9 @@ ioctl_input(struct video *vid)
}
/* copy frame buffer */
- if (buf.length > vid->bpf)
+ if (buf.bytesused > vid->bpf)
return 0;
- memcpy(vid->frame_buffer, vid->mmap_buffer[buf.index], buf.length);
+ memcpy(vid->frame_buffer, vid->mmap_buffer[buf.index], buf.bytesused);
/* requeue buffer */
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;