avconv: make sure packets put into the muxing FIFO are refcounted

Multimedia / Libav - wm4 [googlemail.com] - 1 August 2018 06:55 EDT

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

c011beda2 avconv: make sure packets put into the muxing FIFO are refcounted
avtools/avconv.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

Upstream: git.libav.org


  • Share