linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vb2: Allow queuing OUTPUT buffers with zeroed 'bytesused'
@ 2013-08-26 15:47 Sylwester Nawrocki
  2013-08-27  8:51 ` Laurent Pinchart
  2013-08-27  9:00 ` Marek Szyprowski
  0 siblings, 2 replies; 3+ messages in thread
From: Sylwester Nawrocki @ 2013-08-26 15:47 UTC (permalink / raw)
  To: linux-media
  Cc: m.szyprowski, pawel, hans.verkuil, laurent.pinchart, m.chehab,
	Sylwester Nawrocki, Kyungmin Park

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>
---
 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;
 		}
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] vb2: Allow queuing OUTPUT buffers with zeroed 'bytesused'
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Pinchart @ 2013-08-27  8:51 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-media, m.szyprowski, pawel, hans.verkuil, m.chehab,
	Kyungmin Park

Hi Sylwester,

Thank you for the patch.

On Monday 26 August 2013 17:47:09 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: Laurent Pinchart <laurent.pinchart@ideasonboard.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;
>  		}
-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] vb2: Allow queuing OUTPUT buffers with zeroed 'bytesused'
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Marek Szyprowski @ 2013-08-27  9:00 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-media, pawel, hans.verkuil, laurent.pinchart, m.chehab,
	Kyungmin Park

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-27  9:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).