@@ -854,7 +854,7 @@ static int v4lconvert_convert_pixfmt(struct v4lconvert_data *data,
if (src_size < (width * height)) {
V4LCONVERT_ERR("short grey data frame\n");
errno = EPIPE;
- result = -1;
+ return -1;
}
break;
case V4L2_PIX_FMT_RGB565:
And:
@@ -841,6 +841,11 @@ static int v4lconvert_convert_pixfmt(struct v4lconvert_data *data,
break;
case V4L2_PIX_FMT_GREY:
+ if (src_size < (width * height)) {
+ V4LCONVERT_ERR("short grey data frame\n");
+ errno = EPIPE;
+ return -1;
+ }
switch (dest_pix_fmt) {
case V4L2_PIX_FMT_RGB24:
case V4L2_PIX_FMT_BGR24:
@@ -851,11 +856,6 @@ static int v4lconvert_convert_pixfmt(struct v4lconvert_data *data,
v4lconvert_grey_to_yuv420(src, dest, fmt);
break;
}
- if (src_size < (width * height)) {
- V4LCONVERT_ERR("short grey data frame\n");
- errno = EPIPE;
- return -1;
- }
break;
case V4L2_PIX_FMT_RGB565:
switch (dest_pix_fmt) {