summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMing Qian <ming.qian@nxp.com>2022-12-16 10:08:44 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-10 09:39:45 +0100
commit8f9722ffa4325f8509ec0c145b7a771a09d2ff8e (patch)
tree3165748471635b2c2259b939d08044b49a3dda2d /drivers/media
parentecefc14dd1c93676deb096745e7504b1df5305ed (diff)
downloadlinux-stable-8f9722ffa4325f8509ec0c145b7a771a09d2ff8e.tar.gz
linux-stable-8f9722ffa4325f8509ec0c145b7a771a09d2ff8e.tar.bz2
linux-stable-8f9722ffa4325f8509ec0c145b7a771a09d2ff8e.zip
media: v4l2-jpeg: ignore the unknown APP14 marker
[ Upstream commit 251c0ea6efd3c3ea0f8a55fdd96c749a98639bd3 ] 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. Fixes: b8035f7988a8 ("media: Add parsing for APP14 data segment in jpeg helpers") Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/v4l2-core/v4l2-jpeg.c2
1 files changed, 1 insertions, 1 deletions
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);