libff: Fix heap corruption caused by unnecessary av_dup_packet call
There's no need to duplicate the packet as the reference count will be 1 after the av_read_frame call. Duplicating causes heap corruption when a synthetic clock packet is duplicated and assigned the buffer from the stack-based temporary packet which is then double-freed by the decoder thread.
This commit is contained in:
parent
ba70b44152
commit
bebaeaeaa9
4
deps/libff/libff/ff-packet-queue.c
vendored
4
deps/libff/libff/ff-packet-queue.c
vendored
@ -61,10 +61,6 @@ int packet_queue_put(struct ff_packet_queue *q, struct ff_packet *packet)
|
||||
{
|
||||
struct ff_packet_list *new_packet;
|
||||
|
||||
if (packet != &q->flush_packet
|
||||
&& av_dup_packet(&packet->base) < 0)
|
||||
return FF_PACKET_FAIL;
|
||||
|
||||
new_packet = av_malloc(sizeof(struct ff_packet_list));
|
||||
|
||||
if (new_packet == NULL)
|
||||
|
Loading…
x
Reference in New Issue
Block a user