From 38a15c1df0f2db0b292a8816d0721b834ade5cf1 Mon Sep 17 00:00:00 2001 From: Kamil Debski Date: Thu, 5 Dec 2013 11:05:03 +0100 Subject: v4l2-mfc-example: Add planes array zeroing Planes array has to be zeroed to ensure proper functioning. Signed-off-by: Kamil Debski --- v4l2-mfc-example/fimc.c | 5 +++++ v4l2-mfc-example/mfc.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/v4l2-mfc-example/fimc.c b/v4l2-mfc-example/fimc.c index 9f257d6..4af3aa3 100644 --- a/v4l2-mfc-example/fimc.c +++ b/v4l2-mfc-example/fimc.c @@ -123,6 +123,7 @@ int fimc_setup_output_from_mfc(struct instance *i) int ret; int n; + memzero(planes); for (n = 0; n < MFC_CAP_PLANES; n++) { planes[n].sizeimage = i->mfc.cap_buf_size[n]; planes[n].bytesperline = i->mfc.cap_w; @@ -158,6 +159,7 @@ int fimc_setup_capture_from_fb(struct instance *i) unsigned long fmt; int ret; + memzero(planes); planes[0].sizeimage = i->fb.stride * i->fb.height; planes[0].bytesperline = i->fb.stride; @@ -220,6 +222,7 @@ int fimc_dec_queue_buf_out_from_mfc(struct instance *i, int n) int ret; memzero(buf); + memzero(planes); buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; buf.memory = V4L2_MEMORY_USERPTR; buf.index = n; @@ -253,6 +256,7 @@ int fimc_dec_queue_buf_cap_from_fb(struct instance *i, int n) int ret; memzero(buf); + memzero(planes); buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; buf.memory = V4L2_MEMORY_USERPTR; buf.index = n; @@ -282,6 +286,7 @@ int fimc_dec_dequeue_buf(struct instance *i, int *n, int nplanes, int type) int ret; memzero(buf); + memzero(planes); buf.type = type; buf.memory = V4L2_MEMORY_USERPTR; buf.m.planes = planes; diff --git a/v4l2-mfc-example/mfc.c b/v4l2-mfc-example/mfc.c index b883f3f..89aa22d 100644 --- a/v4l2-mfc-example/mfc.c +++ b/v4l2-mfc-example/mfc.c @@ -119,6 +119,7 @@ int mfc_dec_setup_output(struct instance *i, unsigned long codec, for (n = 0; n < i->mfc.out_buf_cnt; n++) { memzero(buf); + memzero(planes); buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; buf.memory = V4L2_MEMORY_MMAP; buf.index = n; @@ -158,6 +159,7 @@ int mfc_dec_queue_buf(struct instance *i, int n, int l1, int l2, int type, int ret; memzero(qbuf); + memzero(planes); qbuf.type = type; qbuf.memory = V4L2_MEMORY_MMAP; qbuf.index = n; @@ -310,6 +312,7 @@ int mfc_dec_setup_capture(struct instance *i, int extra_buf) for (n = 0; n < i->mfc.cap_buf_cnt; n++) { memzero(buf); + memzero(planes); buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; buf.memory = V4L2_MEMORY_MMAP; buf.index = n; -- cgit v1.2.3