[COMMON] media: smfc: fix missing vertical subasampling check
authorCho KyongHo <pullip.cho@samsung.com>
Thu, 5 Jan 2017 13:40:30 +0000 (22:40 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:19 +0000 (20:22 +0300)
HWJPEG is unable to handle YUV410. Therefore, the driver should check
if both of the horizontal and vertical chroma subsampling factor is 4.
However, the driver checked horizontal factor instead of vertical
factor.

SVACE WGID 2521

Change-Id: I187ff5e4d0c3ff9cf1efdd97b86b7e09c4754af0
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
drivers/media/platform/exynos/smfc/smfc-stream-parser.c

index 528e31a3ba31fce76a818aa9b8398679ff37d3a6..b2d09840a2a09106f6aecf7be170631f2d0b78e7 100644 (file)
@@ -269,7 +269,7 @@ static int smfc_parse_frameheader(struct smfc_ctx *ctx, unsigned long *cursor)
                u8 v = pos[1] & 0xF;
 
                if ((pos[0] < 1) || (pos[0] > 4) || (pos[2] > 4)
-                                               || (h > 4) || (h > 4)) {
+                                               || (h > 4) || (v > 4)) {
                        dev_err(ctx->smfc->dev,
                                "Invalid component data in SOF0 %02x%02x%02x",
                                pos[0], pos[1], pos[2]);