avconv: make sure packets put into the muxing FIFO are refcounted
authorwm4 <nfxjfg@googlemail.com>
Wed, 8 Feb 2017 08:53:26 +0000 (09:53 +0100)
committerMartin Storsjö <martin@martin.st>
Wed, 1 Aug 2018 06:55:34 +0000 (09:55 +0300)
commitc011beda2611acfeb6f67d4fdf30d1eceed9e62f
treebd72babbc3499348517e8e51cbcabc3a6a799f7a
parentc1bcd321ea2c2ae1765a1e64f03278712221d726
avconv: make sure packets put into the muxing FIFO are refcounted

Some callers (like do_subtitle_out(), or do_streamcopy()) call this
with an AVPacket that is not refcounted. This can cause undefined
behavior.

Calling av_packet_move_ref() does not make a packet refcounted if it
isn't yet. (And it can't be made to, because it always succeeds,
and can't return ENOMEM.)

Call av_packet_ref() instead to make sure it's refcounted.

Cc: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
avtools/avconv.c