From 3dd2c8bbbc725bb596eca879908881d252114243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Thu, 1 Sep 2011 20:06:05 +0200 Subject: [PATCH] wav: init st to NULL to avoid a false-positive warning. If st is NULL, it means no 'fmt ' tag is found, but 'data' tag (which needs a previous 'fmt ' tag to be parsed correctly and st initialized) check will make sure st is never dereferenced in that case. --- libavformat/wav.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/wav.c b/libavformat/wav.c index 1ae9413aed..327d8917b8 100644 --- a/libavformat/wav.c +++ b/libavformat/wav.c @@ -387,7 +387,7 @@ static int wav_read_header(AVFormatContext *s, int rf64; unsigned int tag; AVIOContext *pb = s->pb; - AVStream *st; + AVStream *st = NULL; WAVContext *wav = s->priv_data; int ret, got_fmt = 0; int64_t next_tag_ofs, data_ofs = -1;