summaryrefslogtreecommitdiff
path: root/libavformat/mux.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r--libavformat/mux.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c
index f7a7f3a2c9..cb3c297a6b 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -420,7 +420,10 @@ void ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
this_pktl = av_mallocz(sizeof(AVPacketList));
this_pktl->pkt = *pkt;
+#if FF_API_DESTRUCT_PACKET
pkt->destruct = NULL; // do not free original but only the copy
+#endif
+ pkt->buf = NULL;
av_dup_packet(&this_pktl->pkt); // duplicate the packet if it uses non-alloced memory
if (s->streams[pkt->stream_index]->last_in_packet_buffer) {