summaryrefslogtreecommitdiff
path: root/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c
diff options
context:
space:
mode:
authorhans@localhost.localdomain <hans@localhost.localdomain>2008-07-12 21:41:43 +0200
committerhans@localhost.localdomain <hans@localhost.localdomain>2008-07-12 21:41:43 +0200
commitf194278d3ad402f9b2a6d45a6e32b2e18053af74 (patch)
tree45c674fa131ccceba39e9c37ee6a572ca7ed7dca /v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c
parent58cfc4da3781701f2b8da0d4cb6618b6179f223e (diff)
downloadmediapointer-dvb-s2-f194278d3ad402f9b2a6d45a6e32b2e18053af74.tar.gz
mediapointer-dvb-s2-f194278d3ad402f9b2a6d45a6e32b2e18053af74.tar.bz2
libv4l release 0.3.5
From: Hans de Goede <j.w.r.degoede@hhs.nl> * Make JPEG decoding more robust Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
Diffstat (limited to 'v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c')
-rw-r--r--v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c b/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c
index cc733554c..6c6cb693d 100644
--- a/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c
+++ b/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c
@@ -289,12 +289,13 @@ int v4lconvert_convert(struct v4lconvert_data *data,
result = tinyjpeg_decode(data->jdec, TINYJPEG_FMT_YUV420P);
}
- if (result) {
- V4LCONVERT_ERR("decompressing JPEG: %s\n",
+ /* If the JPEG header checked out ok and we get an error during actual
+ decompression, log the error, but don't return an errorcode to the
+ application, so that the user gets what we managed to decompress */
+ if (result)
+ fprintf(stderr, "libv4lconvert: Error decompressing JPEG: %s",
tinyjpeg_get_errorstring(data->jdec));
- errno = EIO;
- return -1;
- }
+
break;
case V4L2_PIX_FMT_SBGGR8:
@@ -363,6 +364,11 @@ int v4lconvert_convert(struct v4lconvert_data *data,
v4lconvert_yuv420_to_bgr24(src, dest, dest_fmt->fmt.pix.width,
dest_fmt->fmt.pix.height);
break;
+
+ default:
+ V4LCONVERT_ERR("Unknown src format in conversion\n");
+ errno = EINVAL;
+ return -1;
}
return needed;