kernel_samsung_a53x/drivers/media/pci
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
..
b2c2 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bt8xx media: bttv: fix use after free error due to btv->timeout timer 2024-11-18 11:43:06 +01:00
cobalt media: cobalt: Use FIELD_GET() to extract Link Width 2024-11-18 11:43:15 +01:00
cx18 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cx88 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cx23885 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cx25821 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ddbridge media: ddbridge: fix an error code problem in ddb_probe 2024-11-18 12:13:18 +01:00
dm1105 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dt3155 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
intel Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ivtv Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mantis Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
meye Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
netup_unidvb Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ngene Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pluto2 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pt1 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pt3 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
saa7134 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
saa7146 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
saa7164 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smipcie Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
solo6x10 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sta2x11 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ttpci media: av7110: prevent underflow in write_ts_to_decoder() 2024-11-18 22:25:34 +01:00
tw68 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tw686x Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tw5864 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