mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 02:39:48 +00:00
media: platform: Improve queue set up flow for bug fixing
[ Upstream commit 5095a6413a
]
Add checking created buffer size follow in mtk_jpeg_queue_setup().
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
372865efb5
commit
2db76a1bd9
1 changed files with 7 additions and 0 deletions
|
@ -579,6 +579,13 @@ static int mtk_jpeg_queue_setup(struct vb2_queue *q,
|
||||||
if (!q_data)
|
if (!q_data)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
if (*num_planes) {
|
||||||
|
for (i = 0; i < *num_planes; i++)
|
||||||
|
if (sizes[i] < q_data->sizeimage[i])
|
||||||
|
return -EINVAL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
*num_planes = q_data->fmt->colplanes;
|
*num_planes = q_data->fmt->colplanes;
|
||||||
for (i = 0; i < q_data->fmt->colplanes; i++) {
|
for (i = 0; i < q_data->fmt->colplanes; i++) {
|
||||||
sizes[i] = q_data->sizeimage[i];
|
sizes[i] = q_data->sizeimage[i];
|
||||||
|
|
Loading…
Reference in a new issue