Check fseek calls in CloseWavFile(espeak-ng.c). [Coverity]

This commit is contained in:
Reece H. Dunn
2016-01-22 19:35:09 +00:00
parent 7ea2cf784d
commit 03fdc8bc31
+4 -4
View File
@@ -233,11 +233,11 @@ static void CloseWavFile()
fflush(f_wavfile);
pos = ftell(f_wavfile);
fseek(f_wavfile, 4, SEEK_SET);
Write4Bytes(f_wavfile, pos - 8);
if (fseek(f_wavfile, 4, SEEK_SET) != -1)
Write4Bytes(f_wavfile, pos - 8);
fseek(f_wavfile, 40, SEEK_SET);
Write4Bytes(f_wavfile, pos - 44);
if (fseek(f_wavfile, 40, SEEK_SET) != -1)
Write4Bytes(f_wavfile, pos - 44);
fclose(f_wavfile);
f_wavfile = NULL;