diff --git a/libavformat/dump.c b/libavformat/dump.c index e3f0056c20..cafcef36c6 100644 --- a/libavformat/dump.c +++ b/libavformat/dump.c @@ -145,10 +145,8 @@ static void dump_metadata(void *ctx, const AVDictionary *m, const char *indent) av_log(ctx, AV_LOG_INFO, "%s %-16s: ", indent, tag->key); while (*p) { - char tmp[256]; size_t len = strcspn(p, "\x8\xa\xb\xc\xd"); - av_strlcpy(tmp, p, FFMIN(sizeof(tmp), len+1)); - av_log(ctx, AV_LOG_INFO, "%s", tmp); + av_log(ctx, AV_LOG_INFO, "%.*s", (int)(FFMIN(255, len)), p); p += len; if (*p == 0xd) av_log(ctx, AV_LOG_INFO, " "); if (*p == 0xa) av_log(ctx, AV_LOG_INFO, "\n%s %-16s: ", indent, "");