History

test: fix uninitialized warning

lieff committed 6 years ago

Commit e660fa71 parent 73c26681 file · +3 −3Browse files

Unified · Split

minimp3_test.c+3−3
@@ -173,7 +173,7 @@ static void decode_file(const char *input_file_name, const unsigned char *buf_re · 172 unmodified lines
173 {173 {
174 mp3dec_ex_t dec;174 mp3dec_ex_t dec;
175 size_t readed;175 size_t readed;
176 uint8_t *buf;176 uint8_t *buf = 0;
177 if (MODE_STREAM == mode)177 if (MODE_STREAM == mode)
178 {178 {
179 res = mp3dec_ex_open(&dec, input_file_name, MP3D_SEEK_TO_SAMPLE);179 res = mp3dec_ex_open(&dec, input_file_name, MP3D_SEEK_TO_SAMPLE);
@@ -183,7 +183,7 @@ static void decode_file(const char *input_file_name, const unsigned char *buf_re · 3 unmodified lines
183 FILE *file = fopen(input_file_name, "rb");183 FILE *file = fopen(input_file_name, "rb");
184 buf = preload(file, &size);184 buf = preload(file, &size);
185 fclose(file);185 fclose(file);
186 res = mp3dec_ex_open_buf(&dec, buf, size, MP3D_SEEK_TO_SAMPLE);186 res = buf ? mp3dec_ex_open_buf(&dec, buf, size, MP3D_SEEK_TO_SAMPLE) : -1;
187 } else if (MODE_STREAM_CB == mode)187 } else if (MODE_STREAM_CB == mode)
188 {188 {
189 FILE *file = fopen(input_file_name, "rb");189 FILE *file = fopen(input_file_name, "rb");
@@ -247,7 +247,7 @@ static void decode_file(const char *input_file_name, const unsigned char *buf_re · 57 unmodified lines
247 exit(1);247 exit(1);
248 }248 }
249 mp3dec_ex_close(&dec);249 mp3dec_ex_close(&dec);
250 if (MODE_STREAM_BUF == mode)250 if (MODE_STREAM_BUF == mode && buf)
251 free(buf);251 free(buf);
252 if (MODE_STREAM_CB == mode)252 if (MODE_STREAM_CB == mode)
253 fclose((FILE*)io.read_data);253 fclose((FILE*)io.read_data);

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