changeset 535:8430e4610971 libavformat

uninitalized variables
author michael
date Tue, 28 Sep 2004 21:09:25 +0000
parents 3846c006af2b
children 76c47c58064f
files avformat.h utils.c
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);
--- 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;
 }