diff options
authorAntonio Ospite <ao2@ao2.it>2014-06-16 15:00:41 (GMT)
committerHans de Goede <hdegoede@redhat.com>2014-06-19 08:26:17 (GMT)
commitf73a4c78f81649cd83ab30fc529678ecd92aa255 (patch)
parentad7e184fb2def78fbb29d14ac64a12e767a4e178 (diff)
libv4lconvert: Fix a regression when converting from Y10Bstable-1.0
Fix a regression introduced in commit efc29f1764a30808ebf7b3e1d9bfa27b909bf641 (libv4lconvert: Reject too short source buffer before accessing it). The old code: case V4L2_PIX_FMT_Y10BPACK: ... if (result == 0 && src_size < (width * height * 10 / 8)) { V4LCONVERT_ERR("short y10b data frame\n"); errno = EPIPE; result = -1; } ... meant to say "If the conversion was *successful* _but_ the frame size was invalid, then take the error path", but in efc29f1764a30808ebf7b3e1d9bfa27b909bf641 this (maybe weird) logic was misunderstood and v4lconvert_convert_pixfmt() was made to return an error even in the case of a successful conversion from Y10B. Drop the no longer needed second check to fix this. Signed-off-by: Antonio Ospite <ao2@ao2.it> Cc: Gregor Jasny <gjasny@googlemail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 files changed, 0 insertions, 5 deletions
diff --git a/lib/libv4lconvert/libv4lconvert.c b/lib/libv4lconvert/libv4lconvert.c
index e2afc27..36c138d 100644
--- a/lib/libv4lconvert/libv4lconvert.c
+++ b/lib/libv4lconvert/libv4lconvert.c
@@ -1048,11 +1048,6 @@ static int v4lconvert_convert_pixfmt(struct v4lconvert_data *data,
width, height);
- if (result == 0) {
- V4LCONVERT_ERR("y10b conversion failed\n");
- errno = EPIPE;
- result = -1;
- }
case V4L2_PIX_FMT_RGB565:

Privacy Policy