Revision 1a5e4fd8 libavcodec/ass.c

View differences:

libavcodec/ass.c
21 21

  
22 22
#include "avcodec.h"
23 23
#include "ass.h"
24
#include "libavutil/avstring.h"
24 25

  
25 26
/**
26 27
 * Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS.
......
117 118
    rects[sub->num_rects]->type = SUBTITLE_ASS;
118 119
    rects[sub->num_rects]->ass  = av_malloc(len + dlen + 1);
119 120
    strcpy (rects[sub->num_rects]->ass      , header);
120
    strncpy(rects[sub->num_rects]->ass + len, dialog, dlen);
121
    rects[sub->num_rects]->ass[len+dlen] = 0;
121
    av_strlcpy(rects[sub->num_rects]->ass + len, dialog, dlen + 1);
122 122
    sub->num_rects++;
123 123
    return dlen;
124 124
}

Also available in: Unified diff