From 3a78a901bbc07d9283a9b80e22be4e9500697745 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 19 May 2010 23:31:39 +0200 Subject: 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 --- main.c | 1 + 1 file changed, 1 insertion(+) (limited to 'main.c') 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; -- cgit v1.2.3