libcamera: formats: Fix planes bounds check
The plane validation in the stride helper incorrectly accepts the number
of planes as a plane index. Fix the off by one issue.
Fixes: e83727a194
("libcamera: PixelFormatInfo: Add functions stride and frameSize")
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
26d9e36d3e
commit
25a8d8b8a9
1 changed files with 1 additions and 1 deletions
|
@ -997,7 +997,7 @@ unsigned int PixelFormatInfo::stride(unsigned int width, unsigned int plane,
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (plane > planes.size() || !planes[plane].bytesPerGroup) {
|
||||
if (plane >= planes.size() || !planes[plane].bytesPerGroup) {
|
||||
LOG(Formats, Warning) << "Invalid plane index, stride is zero";
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue