From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: linux-media@vger.kernel.org, pawel@osciak.com,
hans.verkuil@cisco.com, laurent.pinchart@ideasonboard.com,
m.chehab@samsung.com, Kyungmin Park <kyungmin.park@samsung.com>
Subject: Re: [PATCH] vb2: Allow queuing OUTPUT buffers with zeroed 'bytesused'
Date: Tue, 27 Aug 2013 11:00:08 +0200 [thread overview]
Message-ID: <521C6A98.8000508@samsung.com> (raw)
In-Reply-To: <1377532029-12777-1-git-send-email-s.nawrocki@samsung.com>
Hello,
On 8/26/2013 5:47 PM, Sylwester Nawrocki wrote:
> Modify the bytesused/data_offset check to not fail if both bytesused
> and data_offset is set to 0. This should minimize possible issues in
> existing applications which worked before we enforced the plane lengths
> for output buffers checks introduced in commit 8023ed09cb278004a2
> "videobuf2-core: Verify planes lengths for output buffers"
>
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> drivers/media/v4l2-core/videobuf2-core.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
> index 594c75e..de0e87f 100644
> --- a/drivers/media/v4l2-core/videobuf2-core.c
> +++ b/drivers/media/v4l2-core/videobuf2-core.c
> @@ -353,7 +353,9 @@ static int __verify_length(struct vb2_buffer *vb, const struct v4l2_buffer *b)
>
> if (b->m.planes[plane].bytesused > length)
> return -EINVAL;
> - if (b->m.planes[plane].data_offset >=
> +
> + if (b->m.planes[plane].data_offset > 0 &&
> + b->m.planes[plane].data_offset >=
> b->m.planes[plane].bytesused)
> return -EINVAL;
> }
Best regards
--
Marek Szyprowski
Samsung R&D Institute Poland
prev parent reply other threads:[~2013-08-27 9:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-26 15:47 [PATCH] vb2: Allow queuing OUTPUT buffers with zeroed 'bytesused' Sylwester Nawrocki
2013-08-27 8:51 ` Laurent Pinchart
2013-08-27 9:00 ` Marek Szyprowski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=521C6A98.8000508@samsung.com \
--to=m.szyprowski@samsung.com \
--cc=hans.verkuil@cisco.com \
--cc=kyungmin.park@samsung.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=pawel@osciak.com \
--cc=s.nawrocki@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.