[FFmpeg-cvslog] Prevent double free of side_data when AVFMT_FLAG_KEEP_SIDE_DATA flag is set

Gavin Kinsey git at videolan.org
Thu Sep 8 23:48:56 CEST 2011


ffmpeg | branch: release/0.8 | Gavin Kinsey <gkinsey at ad-holdings.co.uk> | Thu Sep  8 13:01:14 2011 +0100| [e6df35b3be5f722f49390b9950dde78975f33350] | committer: Michael Niedermayer

Prevent double free of side_data when AVFMT_FLAG_KEEP_SIDE_DATA flag is set
(cherry picked from commit d64066f6e88c827e33002b2c7740efd62cd5ba7f)

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

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

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 52b2ae9..a582ddc 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1133,7 +1133,10 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt)
             if (!st->need_parsing || !st->parser) {
                 /* no parsing needed: we just output the packet as is */
                 /* raw data support */
-                *pkt = st->cur_pkt; st->cur_pkt.data= NULL;
+                *pkt = st->cur_pkt;
+                st->cur_pkt.data= NULL;
+                st->cur_pkt.side_data_elems = 0;
+                st->cur_pkt.side_data = NULL;
                 compute_pkt_fields(s, st, NULL, pkt);
                 s->cur_st = NULL;
                 if ((s->iformat->flags & AVFMT_GENERIC_INDEX) &&



More information about the ffmpeg-cvslog mailing list