summaryrefslogtreecommitdiff
path: root/libavformat/mpegts.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r--libavformat/mpegts.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 36ab7ab3af..2479cb6f7d 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -938,10 +938,9 @@ static int mpegts_set_stream_info(AVStream *st, PESContext *pes,
// audio track - add a second stream for this
AVStream *sub_st;
// priv_data cannot be shared between streams
- PESContext *sub_pes = av_malloc(sizeof(*sub_pes));
+ PESContext *sub_pes = av_memdup(pes, sizeof(*sub_pes));
if (!sub_pes)
return AVERROR(ENOMEM);
- memcpy(sub_pes, pes, sizeof(*sub_pes));
sub_st = avformat_new_stream(pes->stream, NULL);
if (!sub_st) {