diff options
author | Alex Converse <aconverse@google.com> | 2011-05-03 11:19:31 -0700 |
---|---|---|
committer | Alex Converse <alex.converse@gmail.com> | 2011-05-03 21:20:13 -0700 |
commit | 1a5e4fd8c5b99478b4e08a69261930bb12aa948b (patch) | |
tree | 305d316548f3f399606e2659ee0fec7e2a13ae59 /libavcodec/ass.c | |
parent | aab6374bbe2b6ce4ca82141be6a5b7b8875bf051 (diff) | |
download | ffmpeg-1a5e4fd8c5b99478b4e08a69261930bb12aa948b.tar.gz |
Replace strncpy() with av_strlcpy().
Diffstat (limited to 'libavcodec/ass.c')
-rw-r--r-- | libavcodec/ass.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/ass.c b/libavcodec/ass.c index beb1ba1141..327a77bb45 100644 --- a/libavcodec/ass.c +++ b/libavcodec/ass.c @@ -21,6 +21,7 @@ #include "avcodec.h" #include "ass.h" +#include "libavutil/avstring.h" /** * Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS. @@ -117,8 +118,7 @@ int ff_ass_add_rect(AVSubtitle *sub, const char *dialog, rects[sub->num_rects]->type = SUBTITLE_ASS; rects[sub->num_rects]->ass = av_malloc(len + dlen + 1); strcpy (rects[sub->num_rects]->ass , header); - strncpy(rects[sub->num_rects]->ass + len, dialog, dlen); - rects[sub->num_rects]->ass[len+dlen] = 0; + av_strlcpy(rects[sub->num_rects]->ass + len, dialog, dlen + 1); sub->num_rects++; return dlen; } |