mirror of
https://github.com/mpv-player/mpv
synced 2025-03-24 12:22:25 +00:00
Replace incorrect usage of strncpy.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30500 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
9d9b7a1e22
commit
78ecbc1e6f
@ -37,6 +37,7 @@
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavformat/avio.h"
|
||||
#include "libavutil/avutil.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavcodec/opt.h"
|
||||
|
||||
#include "mp_taglists.h"
|
||||
@ -462,11 +463,11 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){
|
||||
|
||||
if(demuxer->stream->url) {
|
||||
if (!strncmp(demuxer->stream->url, "ffmpeg://rtsp:", 14))
|
||||
strncpy(mp_filename, demuxer->stream->url + 9, sizeof(mp_filename)-3);
|
||||
av_strlcpy(mp_filename, demuxer->stream->url + 9, sizeof(mp_filename));
|
||||
else
|
||||
strncpy(mp_filename + 3, demuxer->stream->url, sizeof(mp_filename)-3);
|
||||
av_strlcat(mp_filename, demuxer->stream->url, sizeof(mp_filename));
|
||||
} else
|
||||
strncpy(mp_filename + 3, "foobar.dummy", sizeof(mp_filename)-3);
|
||||
av_strlcat(mp_filename, "foobar.dummy", sizeof(mp_filename));
|
||||
|
||||
priv->pb = av_alloc_put_byte(priv->buffer, BIO_BUFFER_SIZE, 0,
|
||||
demuxer->stream, mp_read, NULL, mp_seek);
|
||||
|
Loading…
Reference in New Issue
Block a user