Fix broken for loop in libv4l

Message ID 3fc9b235-4763-546d-c9f6-5ac928a1bcff@selasky.org (mailing list archive)
State Accepted, archived
Delegated to: Hans Verkuil
Headers
Series Fix broken for loop in libv4l |

Commit Message

Hans Petter Selasky April 8, 2020, 5:17 p.m. UTC
  Hi,

This is one in a series of patches. Is this the right place to post 
patches for libv4l ?

Signed-off-by: Hans Petter Selasky <hps@selasky.org>
---
  lib/libv4lconvert/rgbyuv.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

  				*udst++ = *uvsrc++;
  

Comments

Hans Verkuil April 14, 2020, 8:43 a.m. UTC | #1
On 08/04/2020 19:17, Hans Petter Selasky wrote:
> Hi,
> 
> This is one in a series of patches. Is this the right place to post 
> patches for libv4l ?

Yes, this is the right place.

I've applied this patch. Amazing that this hasn't been discovered before.

Thanks!

	Hans

> 
> Signed-off-by: Hans Petter Selasky <hps@selasky.org>
> ---
>   lib/libv4lconvert/rgbyuv.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/libv4lconvert/rgbyuv.c b/lib/libv4lconvert/rgbyuv.c
> index 79bc0bdb..b54b4577 100644
> --- a/lib/libv4lconvert/rgbyuv.c
> +++ b/lib/libv4lconvert/rgbyuv.c
> @@ -893,7 +893,7 @@ void v4lconvert_nv12_to_yuv420(const unsigned char 
> *src, unsigned char *dest,
>   	}
> 
>   	for (i = 0; i < height; i++)
> -		for (j = 0; i < width; j++) {
> +		for (j = 0; j < width; j++) {
>   			*ydst++ = *ysrc++;
>   			if (((i % 2) == 0) && ((j % 2) == 0)) {
>   				*udst++ = *uvsrc++;
>
  

Patch

diff --git a/lib/libv4lconvert/rgbyuv.c b/lib/libv4lconvert/rgbyuv.c
index 79bc0bdb..b54b4577 100644
--- a/lib/libv4lconvert/rgbyuv.c
+++ b/lib/libv4lconvert/rgbyuv.c
@@ -893,7 +893,7 @@  void v4lconvert_nv12_to_yuv420(const unsigned char 
*src, unsigned char *dest,
  	}

  	for (i = 0; i < height; i++)
-		for (j = 0; i < width; j++) {
+		for (j = 0; j < width; j++) {
  			*ydst++ = *ysrc++;
  			if (((i % 2) == 0) && ((j % 2) == 0)) {