public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: "mirela.rabulea@oss.nxp.com" <mirela.rabulea@oss.nxp.com>
To: Ming Qian <ming.qian@nxp.com>,
	mchehab@kernel.org, hverkuil-cisco@xs4all.nl
Cc: shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com, xiahong.bao@nxp.com,
	linux-imx@nxp.com, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] media: v4l2-jpeg: ignore the unknown APP14 marker
Date: Sat, 18 Feb 2023 23:50:52 +0200	[thread overview]
Message-ID: <44dda824-c18a-afb6-d802-bfb87f069f04@oss.nxp.com> (raw)
In-Reply-To: <20221216090844.27262-1-ming.qian@nxp.com>

Hi,

On 16.12.2022 11:08, Ming Qian wrote:
> The legal identifier of APP14 is "Adobe\0",
> but sometimes it may be
> "This is an unknown APP marker . Compliant decoders must ignore it."
> In this case, just ignore it.
> It won't affect the decode result.

I'm not sure, based on the specs only, what the decoders should do if 
the segment does not follow the definition.

I only found this in T.81:
"The APPn (Application) segments are reserved for application use. Since 
these segments may be defined differently for
different applications, they should be removed when the data are 
exchanged between application environments."

And in T.872, the mention about "Adobe\0".

But, I agree ignoring it is more robust, and I confirm imx-jpeg can 
decode such jpegs.

Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>

> 
> Fixes: b8035f7988a8 ("media: Add parsing for APP14 data segment in jpeg helpers")
> Signed-off-by: Ming Qian <ming.qian@nxp.com>
> ---
>   drivers/media/v4l2-core/v4l2-jpeg.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-jpeg.c b/drivers/media/v4l2-core/v4l2-jpeg.c
> index 75c2af763d55..94435a7b6816 100644
> --- a/drivers/media/v4l2-core/v4l2-jpeg.c
> +++ b/drivers/media/v4l2-core/v4l2-jpeg.c
> @@ -460,7 +460,7 @@ static int jpeg_parse_app14_data(struct jpeg_stream *stream,
>   	/* Check for "Adobe\0" in Ap1..6 */
>   	if (stream->curr + 6 > stream->end ||
>   	    strncmp(stream->curr, "Adobe\0", 6))
> -		return -EINVAL;
> +		return jpeg_skip(stream, lp - 2);
>   
>   	/* get to Ap12 */
>   	ret = jpeg_skip(stream, 11);

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-02-18 22:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16  9:08 [PATCH] media: v4l2-jpeg: ignore the unknown APP14 marker Ming Qian
2023-02-18 21:50 ` mirela.rabulea [this message]
2023-02-18 21:51 ` mirela.rabulea

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=44dda824-c18a-afb6-d802-bfb87f069f04@oss.nxp.com \
    --to=mirela.rabulea@oss.nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=ming.qian@nxp.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=xiahong.bao@nxp.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