libv4lconvert.c: fix memset bug discovered by v4l2-compliance.
authorHans Verkuil <hans.verkuil@cisco.com>
Thu, 23 Jun 2011 14:13:37 +0000 (16:13 +0200)
committerHans Verkuil <hans.verkuil@cisco.com>
Thu, 23 Jun 2011 14:13:37 +0000 (16:13 +0200)
The size of the reserved array is 4 * sizeof(u32) = 16. So only the first
element is now zeroed. Use sizeof(reserved) instead.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
lib/libv4lconvert/libv4lconvert.c

index 6935e65..a15f234 100644 (file)
@@ -247,7 +247,7 @@ int v4lconvert_enum_fmt(struct v4lconvert_data *data, struct v4l2_fmtdesc *fmt)
        fmt->description[2] = (faked_fmts[i] >> 16) & 0xff;
        fmt->description[3] = faked_fmts[i] >> 24;
        fmt->description[4] = '\0';
-       memset(fmt->reserved, 0, 4);
+       memset(fmt->reserved, 0, sizeof(fmt->reserved));
 
        return 0;
 }