Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8239958d authored by mandy wang's avatar mandy wang Committed by jackie.lin
Browse files

[ALPS08866253] JPEG Enc occur translation fault



[Description]
For YUYV format,HW image stride is round_up(width*2,32),
but driver set stride is width*2,lead to HW input size
mismatch with driver input size,HW access
address out of bounds.

[Test]
Build and Test ltp_jpegenc and Camera take pictures pass

MTK-Commit-Id: e02f38f201de1ee30714e761e3d6b09756552985

CR-Id: ALPS08866253
Feature: Video Driver
Signed-off-by: default avatarmandy wang <mandy.wang@mediatek.com>
Change-Id: Idbab47cefc2822fdda33f3aed0bbf01d97e0bc9a
parent c53753dd
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -326,6 +326,10 @@ static int mtk_jpeg_try_fmt_mplane(struct v4l2_pix_format_mplane *pix_mp,
			pfmt->bytesperline = stride;
			pfmt->sizeimage = round_up((block_count << 4), 1024) +
					(block_count * round_up((block_w * block_h  * bitsPP / 8), 128));
		} else if (pix_mp->pixelformat == V4L2_PIX_FMT_YUYV) {
			stride = round_up(pix_mp->width * 2, 32);
			pfmt->bytesperline = stride;
			pfmt->sizeimage = stride * h;
		} else {
			pfmt->bytesperline = stride;
			pfmt->sizeimage = stride * h;