linux/drivers/media/test-drivers
Hans Verkuil 92152c4c56 media: vivid: avoid integer overflow
[ Upstream commit 4567ebf8e8 ]

Fixes these compiler warnings:

drivers/media/test-drivers/vivid/vivid-rds-gen.c: In function 'vivid_rds_gen_fill':
drivers/media/test-drivers/vivid/vivid-rds-gen.c:147:56: warning: '.' directive output may be truncated writing 1 byte into a region of size between 0 and 3 [-Wformat-truncation=]
  147 |         snprintf(rds->psname, sizeof(rds->psname), "%6d.%1d",
      |                                                        ^
drivers/media/test-drivers/vivid/vivid-rds-gen.c:147:52: note: directive argument in the range [0, 9]
  147 |         snprintf(rds->psname, sizeof(rds->psname), "%6d.%1d",
      |                                                    ^~~~~~~~~
drivers/media/test-drivers/vivid/vivid-rds-gen.c:147:9: note: 'snprintf' output between 9 and 12 bytes into a destination of size 9
  147 |         snprintf(rds->psname, sizeof(rds->psname), "%6d.%1d",
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  148 |                  freq / 16, ((freq & 0xf) * 10) / 16);
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-28 17:19:46 +00:00
..
vicodec media: vicodec-core: Convert to platform remove callback returning void 2023-04-11 16:59:21 +02:00
vidtv media: vidtv: mux: Add check and kfree for kstrdup 2023-11-20 11:59:32 +01:00
vimc media: Zero-initialize all structures passed to subdev pad operations 2023-04-12 09:46:06 +02:00
visl media: visl-core: Convert to platform remove callback returning void 2023-04-11 16:59:21 +02:00
vivid media: vivid: avoid integer overflow 2023-11-28 17:19:46 +00:00
Kconfig media: visl: add virtual stateless decoder driver 2022-11-25 07:32:16 +00:00
Makefile media: visl: add virtual stateless decoder driver 2022-11-25 07:32:16 +00:00
vim2m.c media: vim2m: Convert to platform remove callback returning void 2023-04-11 16:59:21 +02:00