[FFmpeg-devel] [PATCH 2/3] When copying pkt side_data, don't forget size, type

Andrey Utkin andrey.krieger.utkin at gmail.com
Mon Sep 17 18:55:02 CEST 2012


---
 libavcodec/avpacket.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 03754c5..270fe7e 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -141,9 +141,12 @@ int av_dup_packet(AVPacket *pkt)
             int i;
 
             pkt->side_data = av_mallocz(pkt->side_data_elems * sizeof(*pkt->side_data));
-            for (i = 0; i < pkt->side_data_elems; i++)
+            for (i = 0; i < pkt->side_data_elems; i++) {
                 DUP_DATA(pkt->side_data[i].data, tmp_pkt.side_data[i].data,
                          tmp_pkt.side_data[i].size, 1);
+                pkt->side_data[i].size = tmp_pkt.side_data[i].size;
+                pkt->side_data[i].type = tmp_pkt.side_data[i].type;
+            }
         }
     }
     return 0;
-- 
1.7.8.6



More information about the ffmpeg-devel mailing list