aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-11-25 11:29:07 +0100
committerAnton Khirnov <anton@khirnov.net>2021-12-07 11:16:14 +0100
commit877b6a9e82f73e772b8ac40d4b119f21ee037f0f (patch)
tree0aa646de6397ddba39dbc3277207ee632b6d7242 /libswscale
parentb532ca3d2f1f1caab71c0aab979949882b695198 (diff)
downloadffmpeg-877b6a9e82f73e772b8ac40d4b119f21ee037f0f.tar.gz
lavd/v4l2: detect device name truncation
Silences the following warning with gcc 10: src/libavdevice/v4l2.c: In function ‘v4l2_get_device_list’: src/libavdevice/v4l2.c:1042:64: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 251 [-Wformat-truncation=] 1042 | ret = snprintf(device_name, sizeof(device_name), "/dev/%s", entry->d_name); | ^~ src/libavdevice/v4l2.c:1042:15: note: ‘snprintf’ output between 6 and 261 bytes into a destination of size 256 1042 | ret = snprintf(device_name, sizeof(device_name), "/dev/%s", entry->d_name); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Previous patches intending to silence it have proposed increasing the buffer size, but doing that correctly seems to be tricky. Failing on truncation is simpler and just as effective (as excessively long device names are unlikely).
Diffstat (limited to 'libswscale')
0 files changed, 0 insertions, 0 deletions