diff --git a/src/libavcodec/lavc_common.c b/src/libavcodec/lavc_common.c index 71e1a2617..aaa068124 100644 --- a/src/libavcodec/lavc_common.c +++ b/src/libavcodec/lavc_common.c @@ -355,6 +355,7 @@ get_avpixfmts_names(const enum AVPixelFormat *pixfmts) snprintf(buf, sizeof buf, "(none)"); return buf; } + buf[0] = '\0'; const enum AVPixelFormat *it = pixfmts; while (*it != AV_PIX_FMT_NONE) { snprintf(buf + strlen(buf), sizeof buf - strlen(buf), "%s%s",