diff options
author | Clément Bœsch <ubitux@gmail.com> | 2011-09-01 20:06:05 +0200 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2012-07-23 11:34:08 -0400 |
commit | 61884b9d1b6be16dbbfae6700cf8628e037ea28b (patch) | |
tree | a3f4be0f654bf6ab3199f078cc6cd0d55bdf19ea | |
parent | 37c6ad23451eeda83621d34ff9ab0f6fd2cbf3dd (diff) | |
download | ffmpeg-61884b9d1b6be16dbbfae6700cf8628e037ea28b.tar.gz |
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.
Fixes warning:
libavformat/wav.c: In function ‘wav_read_header’:
libavformat/wav.c:499:44: warning: ‘st’ may be used uninitialized in this function [-Wmaybe-uninitialized]
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
-rw-r--r-- | libavformat/wav.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/wav.c b/libavformat/wav.c index c01121f9db..1bfe6d5eb6 100644 --- a/libavformat/wav.c +++ b/libavformat/wav.c @@ -387,7 +387,7 @@ static int wav_read_header(AVFormatContext *s) int rf64; uint32_t tag, list_type; 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; |