[media] coda: properly clear f_cap in coda_s_fmt_vid_out
authorPhilipp Zabel <p.zabel@pengutronix.de>
Fri, 23 Jan 2015 16:51:22 +0000 (13:51 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 2 Feb 2015 12:02:13 +0000 (10:02 -0200)
Properly zero the structure on the stack before using it.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/platform/coda/coda-common.c

index ff7da3a5c4aed73ad6993bd73937d73e7a225da8..d26794fa74bfd50f44a2d3b311ffb7e6a100a579 100644 (file)
@@ -674,6 +674,7 @@ static int coda_s_fmt_vid_out(struct file *file, void *priv,
 
        ctx->colorspace = f->fmt.pix.colorspace;
 
+       memset(&f_cap, 0, sizeof(f_cap));
        f_cap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        coda_g_fmt(file, priv, &f_cap);
        f_cap.fmt.pix.width = f->fmt.pix.width;