diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2019-11-18 12:07:36 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2019-11-18 12:12:39 +0200 |
commit | f824cccac7311647a8bd22d193d3aac2b961a1dd (patch) | |
tree | 3fd742c256fe0acd92d4a21b0e06944fb2256e14 /kms++/src/dmabufframebuffer.cpp | |
parent | 7a52c7d720398da7df242aeef7be652b54290e94 (diff) |
fbs: use std::array and .at()
Use std::array and .at() to get bounds checking.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'kms++/src/dmabufframebuffer.cpp')
-rw-r--r-- | kms++/src/dmabufframebuffer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kms++/src/dmabufframebuffer.cpp b/kms++/src/dmabufframebuffer.cpp index feac116..d36eb89 100644 --- a/kms++/src/dmabufframebuffer.cpp +++ b/kms++/src/dmabufframebuffer.cpp @@ -32,7 +32,7 @@ DmabufFramebuffer::DmabufFramebuffer(Card& card, uint32_t width, uint32_t height throw std::invalid_argument("the size of fds, pitches and offsets has to match number of planes"); for (int i = 0; i < format_info.num_planes; ++i) { - FramebufferPlane& plane = m_planes[i]; + FramebufferPlane& plane = m_planes.at(i); plane.prime_fd = fds[i]; @@ -65,7 +65,7 @@ DmabufFramebuffer::~DmabufFramebuffer() uint8_t* DmabufFramebuffer::map(unsigned plane) { - FramebufferPlane& p = m_planes[plane]; + FramebufferPlane& p = m_planes.at(plane); if (p.map) return p.map; @@ -80,7 +80,7 @@ uint8_t* DmabufFramebuffer::map(unsigned plane) int DmabufFramebuffer::prime_fd(unsigned plane) { - FramebufferPlane& p = m_planes[plane]; + FramebufferPlane& p = m_planes.at(plane); return p.prime_fd; } |