avcodec/v4l2_m2m: Avoid using intermediate buffer
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: Andriy Gelman <andriy.gelman@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Showing
Please
register
or
sign in
to comment