History

libavformat/riffec: Zero-initialize channels in ff_get_wav_header

Clang's static analyzer complains that leaving the variable uninitialized could lead to a code path where the uninitialized value is written to at the end of this function. This patch simply zero-initializes that variable to avoid that.

Will Cassella committed 4 years ago

Commit e601ec31 parent d4385401 file · +1 −1Browse files

Showing the changes to libavformat (1 of 1 file). Show all

Unified · Split

libavformat/riffdec.c+1−1
@@ -94,7 +94,7 @@ static void parse_waveformatex(AVFormatContext *s, AVIOContext *pb, AVCodecParam · 93 unmodified lines
94int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb,94int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb,
95 AVCodecParameters *par, int size, int big_endian)95 AVCodecParameters *par, int size, int big_endian)
96{96{
97 int id, channels;97 int id, channels = 0;
98 uint64_t bitrate = 0;98 uint64_t bitrate = 0;
99 99
100 if (size < 14) {100 if (size < 14) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t