Commit b482c34d authored by michael's avatar michael

uninitalized variables


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3534 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent a7b11af3
...@@ -42,6 +42,8 @@ typedef struct AVPacket { ...@@ -42,6 +42,8 @@ typedef struct AVPacket {
} AVPacket; } AVPacket;
#define PKT_FLAG_KEY 0x0001 #define PKT_FLAG_KEY 0x0001
void av_destruct_packet_nofree(AVPacket *pkt);
/* initialize optional fields of a packet */ /* initialize optional fields of a packet */
static inline void av_init_packet(AVPacket *pkt) static inline void av_init_packet(AVPacket *pkt)
{ {
...@@ -50,6 +52,7 @@ static inline void av_init_packet(AVPacket *pkt) ...@@ -50,6 +52,7 @@ static inline void av_init_packet(AVPacket *pkt)
pkt->duration = 0; pkt->duration = 0;
pkt->flags = 0; pkt->flags = 0;
pkt->stream_index = 0; pkt->stream_index = 0;
pkt->destruct= av_destruct_packet_nofree;
} }
int av_new_packet(AVPacket *pkt, int size); int av_new_packet(AVPacket *pkt, int size);
......
...@@ -413,6 +413,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, ...@@ -413,6 +413,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
must_open_file = 1; must_open_file = 1;
if (fmt && (fmt->flags & AVFMT_NOFILE)) { if (fmt && (fmt->flags & AVFMT_NOFILE)) {
must_open_file = 0; must_open_file = 0;
pb= NULL; //FIXME this or memset(pb, 0, sizeof(ByteIOContext)); otherwise its uninitalized
} }
if (!fmt || must_open_file) { if (!fmt || must_open_file) {
...@@ -679,7 +680,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, ...@@ -679,7 +680,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
pkt->duration = av_rescale(pkt->duration, AV_TIME_BASE * (int64_t)st->time_base.num, st->time_base.den); 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; pkt->data = NULL; pkt->size = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment