linux/drivers/media/common/v4l2-tpg
Mauro Carvalho Chehab e6a3ea83fb media: v4l2-tpg: prevent the risk of a division by zero
As reported by Coverity, the logic at tpg_precalculate_line()
blindly rescales the buffer even when scaled_witdh is equal to
zero. If this ever happens, this will cause a division by zero.

Instead, add a WARN_ON_ONCE() to trigger such cases and return
without doing any precalculation.

Fixes: 63881df94d ("[media] vivid: add the Test Pattern Generator")
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2024-10-18 10:43:03 +02:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
v4l2-tpg-colors.c media: replace ADOBERGB by OPRGB 2018-09-24 09:21:47 -04:00
v4l2-tpg-core.c media: v4l2-tpg: prevent the risk of a division by zero 2024-10-18 10:43:03 +02:00