From 9fea619f19cd6db78a3457ee929bf006d916035b Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 9 Sep 2012 14:11:34 +0200 Subject: [PATCH] ass: assert that the timsstamps fitted in the buffers Failure of the assert would cause various problems later if we continue. Signed-off-by: Michael Niedermayer --- libavcodec/ass.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/ass.c b/libavcodec/ass.c index 6eb92f7610..db0fdd8504 100644 --- a/libavcodec/ass.c +++ b/libavcodec/ass.c @@ -21,6 +21,7 @@ #include "avcodec.h" #include "ass.h" +#include "libavutil/avassert.h" #include "libavutil/avstring.h" #include "libavutil/common.h" @@ -85,6 +86,7 @@ int ff_ass_add_rect(AVSubtitle *sub, const char *dialog, ts_to_string(s_end, sizeof(s_end), ts_start + duration); len = snprintf(header, sizeof(header), "Dialogue: 0,%s,%s,Default,", s_start, s_end); + av_assert0(len < sizeof(header)); } dlen = strcspn(dialog, "\n");