Module: libav
Branch: release/0.8
Commit: 19d3f7d8ac3f240a5be2058289488dfd47806a01

Author:    Ronald S. Bultje <[email protected]>
Committer: Reinhard Tartler <[email protected]>
Date:      Wed Mar 21 16:10:37 2012 -0700

asf: reset side data elements on packet copy.

Prevents crash (double free) when free()ing the original packet.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: [email protected]
(cherry picked from commit e73c6aaabff1169899184c382385fe9afae5b068)

Signed-off-by: Reinhard Tartler <[email protected]>

---

 libavformat/asfdec.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 969ab28..3b48788 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -1092,6 +1092,8 @@ static int ff_asf_parse_packet(AVFormatContext *s, 
AVIOContext *pb, AVPacket *pk
             //printf("packet %d %d\n", asf_st->pkt.size, 
asf->packet_frag_size);
             asf_st->pkt.size = 0;
             asf_st->pkt.data = 0;
+            asf_st->pkt.side_data_elems = 0;
+            asf_st->pkt.side_data = NULL;
             break; // packet completed
         }
     }

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to