kernel_samsung_a53x/drivers/media/common
Mauro Carvalho Chehab 5be6663698 media: v4l2-tpg: prevent the risk of a division by zero
commit e6a3ea83fbe15d4818d01804e904cbb0e64e543b upstream.

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: 63881df94d3e ("[media] vivid: add the Test Pattern Generator")
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-30 02:33:23 +01:00
..
b2c2 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
saa7146 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
siano Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
v4l2-tpg media: v4l2-tpg: prevent the risk of a division by zero 2024-11-30 02:33:23 +01:00
videobuf2 Revert "media: videobuf2-core: clear memory related fields in __vb2_plane_dmabuf_put()" 2024-11-24 00:22:58 +01:00
btcx-risc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cx2341x.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cypress_firmware.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cypress_firmware.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tveeprom.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00