[FFmpeg-devel] [PATCH 2/3] avpacket: Removing a memset that could cause double free

Vignesh Venkatasubramanian vigneshv at google.com
Fri Aug 30 20:26:52 CEST 2013


Removing a memset from copy_side_data which could potentially cause
double free.

Signed-off-by: Vignesh Venkatasubramanian <vigneshv at google.com>
---
 libavcodec/avpacket.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 7196c31..ac761f1 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -225,8 +225,6 @@ int av_copy_packet_side_data(AVPacket *pkt, AVPacket *src)
         int i;
         DUP_DATA(pkt->side_data, src->side_data,
                 src->side_data_elems * sizeof(*src->side_data), 0, ALLOC_MALLOC);
-        memset(pkt->side_data, 0,
-                src->side_data_elems * sizeof(*src->side_data));
         for (i = 0; i < src->side_data_elems; i++) {
             DUP_DATA(pkt->side_data[i].data, src->side_data[i].data,
                     src->side_data[i].size, 1, ALLOC_MALLOC);
-- 
1.8.4



More information about the ffmpeg-devel mailing list