1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

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>
This commit is contained in:
Clément Bœsch
2011-09-01 20:06:05 +02:00
committed by Derek Buitenhuis
parent 37c6ad2345
commit 61884b9d1b

View File

@@ -387,7 +387,7 @@ static int wav_read_header(AVFormatContext *s)
int rf64; int rf64;
uint32_t tag, list_type; uint32_t tag, list_type;
AVIOContext *pb = s->pb; AVIOContext *pb = s->pb;
AVStream *st; AVStream *st = NULL;
WAVContext *wav = s->priv_data; WAVContext *wav = s->priv_data;
int ret, got_fmt = 0; int ret, got_fmt = 0;
int64_t next_tag_ofs, data_ofs = -1; int64_t next_tag_ofs, data_ofs = -1;