Skip to content
Snippets Groups Projects
Commit f09b2c09 authored by Hans Verkuil's avatar Hans Verkuil
Browse files

qvidcap: fix core dump


The 'cv4l_queue q' variable went out of scope too early,
causing a core dump when g_dataptr was called later.

I suspect it was pure luck that this ever worked, but the changes
to support more than 32 buffers in combination with vivid supporting
this new feature, caused this bug to surface.

Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 93463ab7
No related branches found
No related tags found
No related merge requests found
......@@ -434,6 +434,7 @@ int main(int argc, char **argv)
cv4l_fd fd;
enum AppMode mode = AppModeV4L2;
int sock_fd = -1;
cv4l_queue q;
cv4l_fmt fmt;
v4l2_fract pixelaspect = { 1, 1 };
unsigned cnt = 0;
......@@ -807,7 +808,7 @@ int main(int argc, char **argv)
if (mode == AppModeSocket)
win.setModeSocket(sock_fd, port);
else if (mode == AppModeV4L2) {
cv4l_queue q(fd.g_type(), V4L2_MEMORY_MMAP);
q.init(fd.g_type(), V4L2_MEMORY_MMAP);
q.reqbufs(&fd, v4l2_bufs);
q.obtain_bufs(&fd);
q.queue_all(&fd);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment