ass: assert that the timsstamps fitted in the buffers
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 9 Sep 2012 12:11:34 +0000 (14:11 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 9 Sep 2012 12:19:02 +0000 (14:19 +0200)
Failure of the assert would cause various problems later
if we continue.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/ass.c

index 6eb92f7..db0fdd8 100644 (file)
@@ -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");