• Andreas Rheinhardt's avatar
    avcodec/v4l2_m2m: Avoid using intermediate buffer · 6ee7375e
    Andreas Rheinhardt authored
    Up until now, v4l2_m2m would write via snprintf() into an intermediate
    buffer and then copy from there (via strncpy()) to the end buffer. This
    commit changes this by removing the intermediate buffer.
    
    The call to strncpy() was actually of the form strncpy(dst, src,
    strlen(src) + 1) which is unsafe in general, but safe in this instance
    because dst and src were both of the same size and src was a proper
    zero-terminated string. But this nevertheless led to a compiler warning
    "‘strncpy’ specified bound depends on the length of the source argument
    [-Wstringop-overflow=]" in GCC 9.2. strlen() was unnecessary anyway.
    Reviewed-by: 's avatarAndriy Gelman <andriy.gelman@gmail.com>
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
    6ee7375e
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
configure Loading commit data...