ffmpeg | branch: master | Michael Niedermayer <michae...@gmx.at> | Fri Aug 29 13:02:34 2014 +0200| [72732f2dddabae1d943ce617e0a27e32d13416fb] | committer: Michael Niedermayer
avformat/webmdashenc: use av_strlcpy() and allocate enough space Fixes out of array read Signed-off-by: Michael Niedermayer <michae...@gmx.at> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=72732f2dddabae1d943ce617e0a27e32d13416fb --- libavformat/webmdashenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c index fc77c24..77f6170 100644 --- a/libavformat/webmdashenc.c +++ b/libavformat/webmdashenc.c @@ -203,7 +203,7 @@ static int to_integer(char *p, int len) int ret; char *q = av_malloc(sizeof(char) * len); if (!q) return -1; - strncpy(q, p, len); + av_strlcpy(q, p, len); ret = atoi(q); av_free(q); return ret; @@ -240,7 +240,7 @@ static int parse_adaptation_sets(AVFormatContext *s) while (*q != '\0' && *q != ',' && *q != ' ') q++; as->streams = av_realloc(as->streams, sizeof(*as->streams) * ++as->nb_streams); if (as->streams == NULL) return -1; - as->streams[as->nb_streams - 1] = to_integer(p, q - p); + as->streams[as->nb_streams - 1] = to_integer(p, q - p + 1); if (as->streams[as->nb_streams - 1] < 0) return -1; if (*q == '\0') break; if (*q == ' ') state = new_set; _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog