kernel_samsung_a53x/drivers/media
Dan Carpenter 31ebb0c20b media: av7110: prevent underflow in write_ts_to_decoder()
[ Upstream commit eed9496a0501357aa326ddd6b71408189ed872eb ]

The buf[4] value comes from the user via ts_play().  It is a value in
the u8 range.  The final length we pass to av7110_ipack_instant_repack()
is "len - (buf[4] + 1) - 4" so add a check to ensure that the length is
not negative.  It's not clear that passing a negative len value does
anything bad necessarily, but it's not best practice.

With the new bounds checking the "if (!len)" condition is no longer
possible or required so remove that.

Fixes: fd46d16d602a ("V4L/DVB (11759): dvb-ttpci: Add TS replay capability")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-18 22:25:34 +01:00
..
cec Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
common Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dvb-core media: dvbdev: drop refcount on error path in dvb_device_open() 2024-11-18 12:12:41 +01:00
dvb-frontends media: dvb-frontends: m88ds3103: Fix a memory leak in an error handling path of m88ds3103_probe() 2024-11-18 12:12:41 +01:00
firewire Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c media: ccs: Correctly initialise try compose rectangle 2024-11-18 12:10:56 +01:00
mc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pci media: av7110: prevent underflow in write_ts_to_decoder() 2024-11-18 22:25:34 +01:00
platform media: rockchip: rga: fix swizzling for RGB formats 2024-11-18 12:13:18 +01:00
radio Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rc media: rc: bpf attach/detach requires write permission 2024-11-18 12:13:31 +01:00
spi Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
test-drivers media: vivid: avoid integer overflow 2024-11-18 11:43:15 +01:00
tuners Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
usb media: stk1160: Fixed high volume of stk1160_dbg messages 2024-11-18 12:13:18 +01:00
v4l2-core 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