summaryrefslogtreecommitdiff
path: root/v4l2-apps/libv4l/libv4lconvert
diff options
context:
space:
mode:
authorhans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain>2009-04-14 16:49:43 +0200
committerhans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain>2009-04-14 16:49:43 +0200
commit67f9c69681d56764910ae950b367bc99dfc51d4f (patch)
treea80fbf60ec1863a38d7aed0fba29db76861e0fb1 /v4l2-apps/libv4l/libv4lconvert
parent58d3334b54c207b8e04e7035969e0c2acfa1ce73 (diff)
downloadmediapointer-dvb-s2-67f9c69681d56764910ae950b367bc99dfc51d4f.tar.gz
mediapointer-dvb-s2-67f9c69681d56764910ae950b367bc99dfc51d4f.tar.bz2
libv4l: fix reading wrong memory when doing yuv420->rgb conversion
From: Hans de Goede <hdegoede@redhat.com> Fix reading outside of the source memory when doing yuv420->rgb conversion. Priority: normal Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'v4l2-apps/libv4l/libv4lconvert')
-rw-r--r--v4l2-apps/libv4l/libv4lconvert/rgbyuv.c4
1 files changed, 2 insertions, 2 deletions
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;
}