From b118fe7e7a5c37540e2f0aa75af105e272bad234 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Wed, 18 May 2016 21:56:34 +0200 Subject: [PATCH] Fix STL header writing (really) The vsnprintf call must be passed the buffer size, not the target string size. Shortening the string to field length happens in the memcpy. --- src/subtitle_format_ebu3264.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/subtitle_format_ebu3264.cpp b/src/subtitle_format_ebu3264.cpp index 4c47fa54f..37f6d139d 100644 --- a/src/subtitle_format_ebu3264.cpp +++ b/src/subtitle_format_ebu3264.cpp @@ -531,7 +531,7 @@ namespace char buf[16]; va_list ap; va_start(ap, format); - vsnprintf(buf, fieldlen, format, ap); + vsnprintf(buf, sizeof(buf), format, ap); va_end(ap); memcpy(field, buf, fieldlen); }