Skip to content

Commit a073edc

Browse files
committed
fix maybe-uninitialized warning
1 parent 90deeb6 commit a073edc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/pipeline_cpt_v4l.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ namespace timelapse {
162162
frmsize.pixel_format = fmt.pixelformat;
163163
frmsize.index = 0;
164164
while (v4l2_ioctl(fd, VIDIOC_ENUM_FRAMESIZES, &frmsize) >= 0) {
165-
uint32_t w;
166-
uint32_t h;
165+
uint32_t w = 0;
166+
uint32_t h = 0;
167167
if (frmsize.type == V4L2_FRMSIZE_TYPE_DISCRETE) {
168168
w = frmsize.discrete.width;
169169
h = frmsize.discrete.height;
@@ -172,7 +172,10 @@ namespace timelapse {
172172
h = frmsize.stepwise.max_height;
173173
}
174174

175-
if ((w > v4lfmt.fmt.pix.width && h > v4lfmt.fmt.pix.height && fmt.pixelformat == V4L2_PIX_FMT_RGB24)) {
175+
if (w > v4lfmt.fmt.pix.width &&
176+
h > v4lfmt.fmt.pix.height &&
177+
fmt.pixelformat == V4L2_PIX_FMT_RGB24) {
178+
176179
v4lfmt.fmt.pix.width = w;
177180
v4lfmt.fmt.pix.height = h;
178181
v4lfmt.fmt.pix.pixelformat = fmt.pixelformat;

0 commit comments

Comments
 (0)