[FFmpeg-cvslog] ass: assert that the timsstamps fitted in the buffers

Michael Niedermayer git at videolan.org
Sun Sep 9 14:23:15 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Sep  9 14:11:34 2012 +0200| [9fea619f19cd6db78a3457ee929bf006d916035b] | committer: Michael Niedermayer

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 <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9fea619f19cd6db78a3457ee929bf006d916035b
---

 libavcodec/ass.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/ass.c b/libavcodec/ass.c
index 6eb92f7..db0fdd8 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");



More information about the ffmpeg-cvslog mailing list