]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: vicodec: process all 4 components for RGB32 formats
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Tue, 4 Feb 2020 12:45:04 +0000 (13:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Mar 2020 06:18:34 +0000 (07:18 +0100)
commitbffc9a1796a418b178fffc4f4eb0b995e3adbfab
treec3bf00f3b12597d7688d5218a6d3be1dc383399c
parent72b3f6c85ca1991317d54b4e708fb2ed5c877cbe
media: vicodec: process all 4 components for RGB32 formats

commit 49a56266f96f2c6608373464af8755b431ef1513 upstream.

Only ARGB32-type pixelformat were assumed to have 4 components, which is
wrong since RGB32-type pixelformats may have an alpha channel, so they
should also assume 4 color components.

The XRGB32-type pixelformats really have only 3 color components, but this
complicated matters since that creates strides that are sometimes width * 3
and sometimes width * 4, and in fact this can result in buffer overflows.

Keep things simple by just always processing all 4 color components.

In the future we might want to optimize this again for the XRGB32-type
pixelformats, but for now keep it simple and robust.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: <stable@vger.kernel.org> # for v5.4 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/vicodec/codec-v4l2-fwht.c