Commit 7d0d0b23 authored by Aakarsh Jain's avatar Aakarsh Jain Committed by Hans Verkuil
Browse files

media: s5p-mfc: Corrected NV12M/NV21M plane-sizes



There is a possibility of getting page fault if the overall
buffer size is not aligned to 256bytes. Since MFC does read
operation only and it won't corrupt the data values even if
it reads the extra bytes.
Corrected luma and chroma plane sizes for V4L2_PIX_FMT_NV12M
and V4L2_PIX_FMT_NV21M pixel format.

Suggested-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarAakarsh Jain <aakarsh.jain@samsung.com>
Reviewed-by: default avatarNicolas Dufresne <nicolas.dufresne@collabora.com>
Acked-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
parent 972df327
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -549,8 +549,9 @@ static void s5p_mfc_enc_calc_src_size_v6(struct s5p_mfc_ctx *ctx)
		case V4L2_PIX_FMT_NV21M:
			ctx->stride[0] = ALIGN(ctx->img_width, S5P_FIMV_NV12M_HALIGN_V6);
			ctx->stride[1] = ALIGN(ctx->img_width, S5P_FIMV_NV12M_HALIGN_V6);
			ctx->luma_size = ctx->stride[0] * ALIGN(ctx->img_height, 16);
			ctx->chroma_size =  ctx->stride[0] * ALIGN(ctx->img_height / 2, 16);
			ctx->luma_size = ALIGN(ctx->stride[0] * ALIGN(ctx->img_height, 16), 256);
			ctx->chroma_size = ALIGN(ctx->stride[0] * ALIGN(ctx->img_height / 2, 16),
					256);
			break;
		case V4L2_PIX_FMT_YUV420M:
		case V4L2_PIX_FMT_YVU420M: