Message ID | 20250613143719.1131707-1-barnabas.pocze@ideasonboard.com |
---|---|
State | New |
Headers | show |
Series |
|
Related | show |
Quoting Barnabás Pőcze (2025-06-13 15:37:19) > `plane` must be strictly less than the vector's size, > it cannot be equal to it. > > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > --- > src/apps/common/image.cpp | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/apps/common/image.cpp b/src/apps/common/image.cpp > index a2a0f58f3..9a67238aa 100644 > --- a/src/apps/common/image.cpp > +++ b/src/apps/common/image.cpp > @@ -98,12 +98,12 @@ unsigned int Image::numPlanes() const > > Span<uint8_t> Image::data(unsigned int plane) > { > - assert(plane <= planes_.size()); > + assert(plane < planes_.size()); > return planes_[plane]; > } > > Span<const uint8_t> Image::data(unsigned int plane) const > { > - assert(plane <= planes_.size()); > + assert(plane < planes_.size()); > return planes_[plane]; > } > -- > 2.49.0 >
On Fri, Jun 13, 2025 at 04:37:19PM +0200, Barnabás Pőcze wrote: > `plane` must be strictly less than the vector's size, > it cannot be equal to it. > > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > src/apps/common/image.cpp | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/apps/common/image.cpp b/src/apps/common/image.cpp > index a2a0f58f3..9a67238aa 100644 > --- a/src/apps/common/image.cpp > +++ b/src/apps/common/image.cpp > @@ -98,12 +98,12 @@ unsigned int Image::numPlanes() const > > Span<uint8_t> Image::data(unsigned int plane) > { > - assert(plane <= planes_.size()); > + assert(plane < planes_.size()); > return planes_[plane]; > } > > Span<const uint8_t> Image::data(unsigned int plane) const > { > - assert(plane <= planes_.size()); > + assert(plane < planes_.size()); > return planes_[plane]; > }
diff --git a/src/apps/common/image.cpp b/src/apps/common/image.cpp index a2a0f58f3..9a67238aa 100644 --- a/src/apps/common/image.cpp +++ b/src/apps/common/image.cpp @@ -98,12 +98,12 @@ unsigned int Image::numPlanes() const Span<uint8_t> Image::data(unsigned int plane) { - assert(plane <= planes_.size()); + assert(plane < planes_.size()); return planes_[plane]; } Span<const uint8_t> Image::data(unsigned int plane) const { - assert(plane <= planes_.size()); + assert(plane < planes_.size()); return planes_[plane]; }
`plane` must be strictly less than the vector's size, it cannot be equal to it. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- src/apps/common/image.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)