summaryrefslogtreecommitdiff
path: root/test/signal.cpp
diff options
context:
space:
mode:
authorDavid Plowman <david.plowman@raspberrypi.com>2021-09-28 16:36:34 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-10-05 15:19:04 +0300
commita733e0647a2c3cbbacac9110b01afa1e2a2d68d7 (patch)
tree8c14203a9684bd0d81611e67b73d6123096baa7a /test/signal.cpp
parent1de0f90dd43200b0f101b8c732c35c2669d027ad (diff)
libcamera: Fix crash caused by reading uninitialised delayed controls
The cause is that we read out delayed values using a frame's sequence number (DelayedControls::get). But we fill the values up (DelayedControls::applyControls) incrementing writeCount by only one even if the sequence number has jumped by several since last time. This is exactly what happens when frames are being dropped. So the fix is to increment writeCount by "as much as the sequence number has jumped since last time", which means that we just follow the sequence number directly. Bug: https://bugs.libcamera.org/show_bug.cgi?id=74 Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'test/signal.cpp')
0 files changed, 0 insertions, 0 deletions
* Copyright (C) 2019, Google Inc. * * v4l2_camera_proxy.h - Proxy to V4L2 compatibility camera */ #pragma once #include <linux/videodev2.h> #include <map> #include <memory> #include <set> #include <sys/types.h> #include <vector> #include <libcamera/base/mutex.h> #include <libcamera/camera.h> #include "v4l2_camera.h" class V4L2CameraFile; class V4L2CameraProxy { public: V4L2CameraProxy(unsigned int index, std::shared_ptr<libcamera::Camera> camera); int open(V4L2CameraFile *file); void close(V4L2CameraFile *file); void *mmap(V4L2CameraFile *file, void *addr, size_t length, int prot, int flags, off64_t offset); int munmap(V4L2CameraFile *file, void *addr, size_t length); int ioctl(V4L2CameraFile *file, unsigned long request, void *arg); private: bool validateBufferType(uint32_t type);