[FFmpeg-cvslog] avpacket: reset dst side_data fields in av_packet_copy_props

Yusuke Nakamura git at videolan.org
Thu Feb 15 01:37:02 EET 2018


ffmpeg | branch: master | Yusuke Nakamura <muken.the.vfrmaniac at gmail.com> | Wed Feb 14 11:43:24 2018 +0900| [3b4026e15110547892d5d770b6b43c9e34df458f] | committer: James Almer

avpacket: reset dst side_data fields in av_packet_copy_props

This effectively copies the side data elements from src instead of
potentially merging them with those already existing in dst.
This by extension also removes the only dependency on existing values
in the dst packet.

Reviewed-by: wm4 <nfxjfg at googlemail.com>
Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3b4026e15110547892d5d770b6b43c9e34df458f
---

 libavcodec/avpacket.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 90b8215928..fe8113ab76 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -571,6 +571,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
     dst->flags                = src->flags;
     dst->stream_index         = src->stream_index;
 
+    dst->side_data            = NULL;
+    dst->side_data_elems      = 0;
     for (i = 0; i < src->side_data_elems; i++) {
          enum AVPacketSideDataType type = src->side_data[i].type;
          int size          = src->side_data[i].size;



More information about the ffmpeg-cvslog mailing list