aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-06-29 08:48:26 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-06-29 08:48:26 +0000
commit2577897d2bafd31e0565e8d3d69a4a72dfba8254 (patch)
tree471585a8320aa26937a4e462bd0ffef19644124d /libavformat/utils.c
parent73480a1552c313b46737e81053250fd86b2b4085 (diff)
downloadffmpeg-2577897d2bafd31e0565e8d3d69a4a72dfba8254.tar.gz
fix assertion failure
Originally committed as revision 4411 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index d87795822a..14d8574a91 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2286,6 +2286,8 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt)
/**
* interleave_packet implementation which will interleave per DTS.
+ * packets with pkt->destruct == av_destruct_packet will be freed inside this function.
+ * so they cannot be used after it, note calling av_free_packet() on them is still safe
*/
static int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush){
AVPacketList *pktl, **next_point, *this_pktl;
@@ -2295,11 +2297,14 @@ static int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPac
if(pkt){
AVStream *st= s->streams[ pkt->stream_index];
- assert(pkt->destruct != av_destruct_packet); //FIXME
+// assert(pkt->destruct != av_destruct_packet); //FIXME
this_pktl = av_mallocz(sizeof(AVPacketList));
this_pktl->pkt= *pkt;
- av_dup_packet(&this_pktl->pkt);
+ if(pkt->destruct == av_destruct_packet)
+ pkt->destruct= NULL; // non shared -> must keep original from being freed
+ else
+ av_dup_packet(&this_pktl->pkt); //shared -> must dup
next_point = &s->packet_buffer;
while(*next_point){