[FFmpeg-cvslog] wav: init st to NULL to avoid a false-positive warning.

Clément Bœsch git at videolan.org
Thu Sep 1 20:26:44 CEST 2011


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Thu Sep  1 20:06:05 2011 +0200| [3dd2c8bbbc725bb596eca879908881d252114243] | committer: Clément Bœsch

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.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3dd2c8bbbc725bb596eca879908881d252114243
---

 libavformat/wav.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/wav.c b/libavformat/wav.c
index 1ae9413..327d891 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;



More information about the ffmpeg-cvslog mailing list