linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gregor Jasny <gjasny@googlemail.com>
To: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH v2 2/2] libv4lconvert: Support for RGB32 and BGR32 format
Date: Sat, 03 Aug 2013 18:42:29 +0200	[thread overview]
Message-ID: <51FD32F5.40200@googlemail.com> (raw)
In-Reply-To: <1375483372-4354-3-git-send-email-ricardo.ribalda@gmail.com>

On 8/3/13 12:42 AM, Ricardo Ribalda Delgado wrote:
> +	case V4L2_PIX_FMT_RGB32:
> +		switch (dest_pix_fmt) {
> +		case V4L2_PIX_FMT_RGB24:
> +			v4lconvert_rgb32_to_rgb24(src, dest, width, height, 0);
> +			break;
> +		case V4L2_PIX_FMT_BGR24:
> +			v4lconvert_rgb32_to_rgb24(src, dest, width, height, 1);
> +			break;
> +		case V4L2_PIX_FMT_YUV420:
> +			v4lconvert_rgb24_to_yuv420(src, dest, fmt, 0, 0, 4);
> +			break;
> +		case V4L2_PIX_FMT_YVU420:
> +			v4lconvert_rgb24_to_yuv420(src, dest, fmt, 0, 1, 4);
> +			break;
> +		}
> +		if (src_size < (width * height * 4)) {
> +			V4LCONVERT_ERR("short rgb32 data frame\n");
> +			errno = EPIPE;
> +			result = -1;
> +		}
> +		break;

I have not looked at the whole function but shouldn't this sanity check 
happen before the actual work? Also aren't you applying the condition 
here also for rgb24_to_xxx which should have only three bpp?

> +	case V4L2_PIX_FMT_BGR32:
> +		switch (dest_pix_fmt) {
> +		case V4L2_PIX_FMT_RGB24:
> +			v4lconvert_rgb32_to_rgb24(src, dest, width, height, 1);
> +			break;
> +		case V4L2_PIX_FMT_BGR24:
> +			v4lconvert_rgb32_to_rgb24(src, dest, width, height, 0);
> +			break;
> +		case V4L2_PIX_FMT_YUV420:
> +			v4lconvert_rgb24_to_yuv420(src, dest, fmt, 1, 0, 4);
> +			break;
> +		case V4L2_PIX_FMT_YVU420:
> +			v4lconvert_rgb24_to_yuv420(src, dest, fmt, 1, 1, 4);
> +			break;
> +		}
> +		if (src_size < (width * height * 4)) {
> +			V4LCONVERT_ERR("short bgr32 data frame\n");
> +			errno = EPIPE;
> +			result = -1;
> +		}
> +		break;

Same here. And also in the other patch.



  reply	other threads:[~2013-08-03 16:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-02 22:42 [PATCH v2 0/2] Add support for V4L2_PIX_FMT_Y16, V4L2_PIX_FMT_RGB32 and V4L2_PIX_FMT_BGR32 Ricardo Ribalda Delgado
2013-08-02 22:42 ` [PATCH v2 1/2] libv4lconvert: Support for Y16 pixel format Ricardo Ribalda Delgado
2013-08-09 16:04   ` Ricardo Ribalda Delgado
2013-08-12 19:39     ` Gregor Jasny
2013-08-12 20:29       ` Ricardo Ribalda Delgado
2013-08-13  8:56       ` Hans de Goede
2013-08-16 16:03         ` Gregor Jasny
2013-08-02 22:42 ` [PATCH v2 2/2] libv4lconvert: Support for RGB32 and BGR32 format Ricardo Ribalda Delgado
2013-08-03 16:42   ` Gregor Jasny [this message]
2013-08-04  8:05     ` Ricardo Ribalda Delgado
2013-08-09 16:03       ` Ricardo Ribalda Delgado

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51FD32F5.40200@googlemail.com \
    --to=gjasny@googlemail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=ricardo.ribalda@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).