summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--v4l2-apps/libv4l/ChangeLog1
-rw-r--r--v4l2-apps/libv4l/libv4l2/log.c12
-rw-r--r--v4l2-apps/libv4l/libv4lconvert/rgbyuv.c4
3 files changed, 9 insertions, 8 deletions
diff --git a/v4l2-apps/libv4l/ChangeLog b/v4l2-apps/libv4l/ChangeLog
index 3a7d3f3a8..b1f4c3a22 100644
--- a/v4l2-apps/libv4l/ChangeLog
+++ b/v4l2-apps/libv4l/ChangeLog
@@ -24,6 +24,7 @@ libv4l-0.5.97
* adjust libv4l's upside down cam detection to also work with devices
which have the usb interface as parent instead of the usb device
* fix libv4l upside down detection for the new v4l minor numbering scheme
+* fix reading outside of the source memory when doing yuv420->rgb conversion
libv4l-0.5.9
------------
diff --git a/v4l2-apps/libv4l/libv4l2/log.c b/v4l2-apps/libv4l/libv4l2/log.c
index 251b46ecf..a08ae3554 100644
--- a/v4l2-apps/libv4l/libv4l2/log.c
+++ b/v4l2-apps/libv4l/libv4l2/log.c
@@ -163,7 +163,7 @@ void v4l2_log_ioctl(unsigned long int request, void *arg, int result)
struct v4l2_frmsizeenum *frmsize = arg;
int pixfmt = frmsize->pixel_format;
- fprintf(v4l2_log_file, " index: %u pixelformat: %c%c%c%c",
+ fprintf(v4l2_log_file, " index: %u pixelformat: %c%c%c%c\n",
frmsize->index,
pixfmt & 0xff,
(pixfmt >> 8) & 0xff,
@@ -171,12 +171,12 @@ void v4l2_log_ioctl(unsigned long int request, void *arg, int result)
pixfmt >> 24);
switch (frmsize->type) {
case V4L2_FRMSIZE_TYPE_DISCRETE:
- fprintf(v4l2_log_file, " %ux%u\n", frmsize->discrete.width,
+ fprintf(v4l2_log_file, " %ux%u\n", frmsize->discrete.width,
frmsize->discrete.height);
break;
case V4L2_FRMSIZE_TYPE_CONTINUOUS:
case V4L2_FRMSIZE_TYPE_STEPWISE:
- fprintf(v4l2_log_file, " %ux%u -> %ux%u\n",
+ fprintf(v4l2_log_file, " %ux%u -> %ux%u\n",
frmsize->stepwise.min_width, frmsize->stepwise.min_height,
frmsize->stepwise.max_width, frmsize->stepwise.max_height);
break;
@@ -188,7 +188,7 @@ void v4l2_log_ioctl(unsigned long int request, void *arg, int result)
struct v4l2_frmivalenum *frmival = arg;
int pixfmt = frmival->pixel_format;
- fprintf(v4l2_log_file, " index: %u pixelformat: %c%c%c%c %ux%u: ",
+ fprintf(v4l2_log_file, " index: %u pixelformat: %c%c%c%c %ux%u:\n",
frmival->index,
pixfmt & 0xff,
(pixfmt >> 8) & 0xff,
@@ -198,12 +198,12 @@ void v4l2_log_ioctl(unsigned long int request, void *arg, int result)
frmival->height);
switch (frmival->type) {
case V4L2_FRMIVAL_TYPE_DISCRETE:
- fprintf(v4l2_log_file, "%u/%u\n", frmival->discrete.numerator,
+ fprintf(v4l2_log_file, " %u/%u\n", frmival->discrete.numerator,
frmival->discrete.denominator);
break;
case V4L2_FRMIVAL_TYPE_CONTINUOUS:
case V4L2_FRMIVAL_TYPE_STEPWISE:
- fprintf(v4l2_log_file, "%u/%u -> %u/%u\n",
+ fprintf(v4l2_log_file, " %u/%u -> %u/%u\n",
frmival->stepwise.min.numerator,
frmival->stepwise.min.denominator,
frmival->stepwise.max.numerator,
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;
}