From 33e73f4efde974584c9b577ea31f4441ae4545b5 Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Fri, 6 Jan 2023 14:11:06 -0800 Subject: [PATCH] demux: new packet should not point to source buffer when copying data In `new_demux_packet_from`, we initialise a new packet and allocate a buffer which we copy the source data into. But I was then assigning the original source pointer as the packet's buffer, rather than keeping the newly allocated one. Whoops. --- demux/packet.c | 1 - 1 file changed, 1 deletion(-) diff --git a/demux/packet.c b/demux/packet.c index d42470c5fe..467606050a 100644 --- a/demux/packet.c +++ b/demux/packet.c @@ -120,7 +120,6 @@ struct demux_packet *new_demux_packet_from(void *data, size_t len) if (!dp) return NULL; memcpy(dp->avpacket->data, data, len); - dp->buffer = data; return dp; }