# HG changeset patch # User michael # Date 1096405765 0 # Node ID 8430e46109715c60a26f226d8517c25fb4083065 # Parent 3846c006af2bd39318c1f376c8a3aebcf1d2b13b uninitalized variables diff -r 3846c006af2b -r 8430e4610971 avformat.h --- a/avformat.h Tue Sep 28 09:55:44 2004 +0000 +++ b/avformat.h Tue Sep 28 21:09:25 2004 +0000 @@ -42,6 +42,8 @@ } AVPacket; #define PKT_FLAG_KEY 0x0001 +void av_destruct_packet_nofree(AVPacket *pkt); + /* initialize optional fields of a packet */ static inline void av_init_packet(AVPacket *pkt) { @@ -50,6 +52,7 @@ pkt->duration = 0; pkt->flags = 0; pkt->stream_index = 0; + pkt->destruct= av_destruct_packet_nofree; } int av_new_packet(AVPacket *pkt, int size); diff -r 3846c006af2b -r 8430e4610971 utils.c --- a/utils.c Tue Sep 28 09:55:44 2004 +0000 +++ b/utils.c Tue Sep 28 21:09:25 2004 +0000 @@ -413,6 +413,7 @@ must_open_file = 1; if (fmt && (fmt->flags & AVFMT_NOFILE)) { must_open_file = 0; + pb= NULL; //FIXME this or memset(pb, 0, sizeof(ByteIOContext)); otherwise its uninitalized } if (!fmt || must_open_file) { @@ -679,7 +680,7 @@ pkt->duration = av_rescale(pkt->duration, AV_TIME_BASE * (int64_t)st->time_base.num, st->time_base.den); } -static void av_destruct_packet_nofree(AVPacket *pkt) +void av_destruct_packet_nofree(AVPacket *pkt) { pkt->data = NULL; pkt->size = 0; }