From 67f9c69681d56764910ae950b367bc99dfc51d4f Mon Sep 17 00:00:00 2001 From: "hans@rhel5-devel.localdomain" Date: Tue, 14 Apr 2009 16:49:43 +0200 Subject: libv4l: fix reading wrong memory when doing yuv420->rgb conversion From: Hans de Goede Fix reading outside of the source memory when doing yuv420->rgb conversion. Priority: normal Signed-off-by: Hans de Goede --- v4l2-apps/libv4l/libv4lconvert/rgbyuv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'v4l2-apps/libv4l/libv4lconvert/rgbyuv.c') diff --git a/v4l2-apps/libv4l/libv4lconvert/rgbyuv.c b/v4l2-apps/libv4l/libv4lconvert/rgbyuv.c index 00706be9d..3fbff8e85 100644 --- a/v4l2-apps/libv4l/libv4lconvert/rgbyuv.c +++ b/v4l2-apps/libv4l/libv4lconvert/rgbyuv.c @@ -135,7 +135,7 @@ void v4lconvert_yuv420_to_bgr24(const unsigned char *src, unsigned char *dest, vsrc++; } /* Rewind u and v for next line */ - if (i&1) { + if (!(i&1)) { usrc -= width / 2; vsrc -= width / 2; } @@ -189,7 +189,7 @@ void v4lconvert_yuv420_to_rgb24(const unsigned char *src, unsigned char *dest, vsrc++; } /* Rewind u and v for next line */ - if (i&1) { + if (!(i&1)) { usrc -= width / 2; vsrc -= width / 2; } -- cgit v1.2.3 From 9919241faa605f4024a77e4e01c5cc4f6676bfe7 Mon Sep 17 00:00:00 2001 From: "hans@rhel5-devel.localdomain" Date: Sun, 17 May 2009 15:18:29 +0200 Subject: libv4l: fix v4lconvert_uyvy_to_yuv420() From: Hans de Goede v4lconvert_uyvy_to_yuv420() had a bug causing the result to be all messed up, also see: http://bugzilla.gnome.org/show_bug.cgi?id=571772 Priority: normal Signed-off-by: Hans de Goede --- v4l2-apps/libv4l/libv4lconvert/rgbyuv.c | 1 - 1 file changed, 1 deletion(-) (limited to 'v4l2-apps/libv4l/libv4lconvert/rgbyuv.c') diff --git a/v4l2-apps/libv4l/libv4lconvert/rgbyuv.c b/v4l2-apps/libv4l/libv4lconvert/rgbyuv.c index 3fbff8e85..31cbc3c68 100644 --- a/v4l2-apps/libv4l/libv4lconvert/rgbyuv.c +++ b/v4l2-apps/libv4l/libv4lconvert/rgbyuv.c @@ -409,7 +409,6 @@ void v4lconvert_uyvy_to_yuv420(const unsigned char *src, unsigned char *dest, } /* copy the U and V values */ - src++; /* point to V */ src1 = src + width * 2; /* next line */ if (yvu) { vdest = dest; -- cgit v1.2.3