summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-05-19 23:31:39 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-05-19 23:31:39 +0200
commit3a78a901bbc07d9283a9b80e22be4e9500697745 (patch)
treecf48ae5482b99841091e8892512678a58374d45b /main.c
parent5154f4d6f89e9853b768fc0ec470fa4dff5f890a (diff)
Zero structures before filling them
The parse_format function fills a v4l2_mbus_framefmt structure but doesn't zero it beforehand. This results in some fields being uninitialized. Fix this. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'main.c')
-rw-r--r--main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/main.c b/main.c
index ab76c84..40058fe 100644
--- a/main.c
+++ b/main.c
@@ -223,6 +223,7 @@ static int parse_format(struct v4l2_mbus_framefmt *format, const char *p, char *
height = strtoul(p, &end, 10);
*endp = end;
+ memset(format, 0, sizeof(*format));
format->width = width;
format->height = height;
format->code = mbus_formats[i].code;