diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2019-09-26 02:05:58 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2019-09-25 21:54:18 -0300 |
commit | b6be2be765b3f9104ca5bc9f608a934db0fc012a (patch) | |
tree | 3ebabff81ec6a649a30cc448f83153af2278b096 /libavformat/utils.c | |
parent | 4f589d668efdabc3764dcb0094929c2b4e01b35c (diff) | |
download | ffmpeg-b6be2be765b3f9104ca5bc9f608a934db0fc012a.tar.gz |
avformat/utils: ensure that all packets in AVPacketList are reference counted
This is done so that its data is really owned by the packet.
This was already true for the current callers.
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 19fee40eec..9f8a5bfb63 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -460,6 +460,11 @@ int ff_packet_list_put(AVPacketList **packet_buffer, return ret; } } else { + ret = av_packet_make_refcounted(pkt); + if (ret < 0) { + av_free(pktl); + return ret; + } av_packet_move_ref(&pktl->pkt, pkt); } |