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>
This commit is contained in:
parent
1de0f90dd4
commit
a733e0647a
1 changed files with 1 additions and 1 deletions
|
@ -279,7 +279,7 @@ void DelayedControls::applyControls(uint32_t sequence)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
writeCount_++;
|
writeCount_ = sequence - firstSequence_ + 1;
|
||||||
|
|
||||||
while (writeCount_ > queueCount_) {
|
while (writeCount_ > queueCount_) {
|
||||||
LOG(DelayedControls, Debug)
|
LOG(DelayedControls, Debug)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue