1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-13 14:13:32 +02:00

Add error check comments.

These are places where we don't properly handle error returns.
This commit is contained in:
James Crook
2016-07-09 21:20:35 +01:00
parent c8d5905bd3
commit 763485b0dc
19 changed files with 50 additions and 18 deletions

View File

@@ -304,6 +304,8 @@ std::unique_ptr<ImportFileHandle> FLACImportPlugin::Open(const wxString &filenam
return nullptr; // File not found
}
// FIXME: TRAP_ERR wxFILE ops in FLAC Import could fail.
// Seek() return value is not examined, for example.
#ifdef USE_LIBID3TAG
// Skip any ID3 tags that might be present
id3_byte_t query[ID3_TAG_QUERYSIZE];

View File

@@ -106,6 +106,7 @@ size_t MultiFormatReader::Read(void* buffer, size_t size, size_t len, size_t str
for (size_t n = 0; n < len; n++)
{
actRead += fread(&(pWork[n*size]), size, 1, mpFid);
// FIXME: TRAP_ERR fseek return in MultiFormatReader unchecked.
fseek(mpFid, (stride - 1) * size, SEEK_CUR);
}
}

View File

@@ -1066,8 +1066,10 @@ int RawAudioGuess(const wxString &in_fname,
*out_channels = 1;
wxFFile in_wxFFile(in_fname, wxT("rb"));
// JKC FALSE changed to -1.
if (!in_wxFFile.IsOpened())
return false;
return -1;
inf = in_wxFFile.fp();
if (!inf) {
@@ -1079,6 +1081,7 @@ int RawAudioGuess(const wxString &in_fname,
return -1;
}
// FIXME: TRAP_ERR fseek return in RawAudioGuess unchecked.
fseek(inf, 0, SEEK_END);
fileLen = ftell(inf);
@@ -1100,6 +1103,7 @@ int RawAudioGuess(const wxString &in_fname,
/* Make it a multiple of 16 (stereo double-precision) */
startPoint = (startPoint/16)*16;
// FIXME: TRAP_ERR fseek return in MultiFormatReader unchecked.
fseek(inf, headerSkipSize + startPoint, SEEK_SET);
read_data = fread(rawData[test], 1, dataSize, inf);
if (read_data != dataSize && ferror(inf)) {