Re: [FFmpeg-devel] [PATCH 1/2] avformat/dashdec: Ensure strings are zero-terminated

2021-03-02 Thread Steven Liu
> 2021年3月2日 下午6:38,Andreas Rheinhardt 写道: > > strncpy only ensures that one does not write beyond the end of the > destination buffer; in case of truncation it does not zero-terminate > the destination buffer. This makes using it the way it is now in the > DASH demuxer dangerous. So use av_strl

[FFmpeg-devel] [PATCH 1/2] avformat/dashdec: Ensure strings are zero-terminated

2021-03-02 Thread Andreas Rheinhardt
strncpy only ensures that one does not write beyond the end of the destination buffer; in case of truncation it does not zero-terminate the destination buffer. This makes using it the way it is now in the DASH demuxer dangerous. So use av_strlcpy instead. Also don't write anything if there is no i