[PATCH v2 3/4] media: v4l2-jpeg: skip the rest of a quantization table segment
From: Arun Iyengar via B4 Relay
Date: Sat Dec 05 2026 - 04:24:39 EST
From: Arun Iyengar <aiyengar1990@xxxxxxxxx>
Bytes left in the segment after the last table are not skipped, so the
next marker search scans them. A segment that ends in FF C4, for
example, fails with -EINVAL.
Fixes: 50733b5b9102 ("media: add v4l2 JPEG helpers")
Suggested-by: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>
Signed-off-by: Arun Iyengar <aiyengar1990@xxxxxxxxx>
---
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 f900e29f9a84d..3951e4b56a32f 100644
--- a/drivers/media/v4l2-core/v4l2-jpeg.c
+++ b/drivers/media/v4l2-core/v4l2-jpeg.c
@@ -470,7 +470,7 @@ static int jpeg_parse_quantization_tables(struct jpeg_stream *stream,
len -= pq ? 129 : 65;
}
- return 0;
+ return jpeg_skip(stream, len);
}
/* B.2.4.2 Huffman table-specification syntax */
--
2.55.0