linux/drivers/media
Rikard Falkeborn c8470b7de8 media: venus: helpers: Fix ALIGN() of non power of two
[ Upstream commit 927e78ac8b ]

ALIGN() expects its second argument to be a power of 2, otherwise
incorrect results are produced for some inputs. The output can be
both larger or smaller than what is expected.

For example, ALIGN(304, 192) equals 320 instead of 384, and
ALIGN(65, 192) equals 256 instead of 192.

However, nestling two ALIGN() as is done in this case seem to only
produce results equal to or bigger than the expected result if ALIGN()
had handled non powers of two, and that in turn results in framesizes
that are either the correct size or too large.

Fortunately, since 192 * 4 / 3 equals 256, it turns out that one ALIGN()
is sufficient.

Fixes: ab1eda449c ("media: venus: vdec: handle 10bit bitstreams")
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-19 16:21:54 +02:00
..
cec media: cec: core: don't set last_initiator if tx in progress 2023-06-28 11:12:35 +02:00
common
dvb-core media: dvb-core: Fix use-after-free due to race condition at dvb_ca_en50221 2023-06-09 10:34:13 +02:00
dvb-frontends media: mn88443x: fix !CONFIG_OF error by drop of_match_ptr from ID table 2023-06-09 10:34:12 +02:00
firewire
i2c media: hi846: fix usage of pm_runtime_get_if_in_use() 2023-07-19 16:21:51 +02:00
mc
mmc
pci media: netup_unidvb: fix irq init by register it at the end of probe 2023-06-09 10:34:12 +02:00
platform media: venus: helpers: Fix ALIGN() of non power of two 2023-07-19 16:21:54 +02:00
radio media: radio-shark: Add endpoint checks 2023-05-30 14:03:20 +01:00
rc
spi
test-drivers
tuners
usb media: usb: siano: Fix warning due to null work_func_t function pointer 2023-07-19 16:21:50 +02:00
v4l2-core
Kconfig
Makefile