[misc] fix Coverity warnings

* Also re-instate the _coverity.cmd script and try to fix AppVeyor Coverity uploads
This commit is contained in:
Pete Batard 2020-06-19 10:53:40 +01:00
parent 1e85b4dbf5
commit c8078b0119
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
7 changed files with 45 additions and 17 deletions

View file

@ -972,6 +972,8 @@ static BOOL WriteSBR(HANDLE hPhysicalDrive)
(DWORD)(SelectedDrive.SectorsPerTrack * SelectedDrive.SectorSize) : 1 * MB;
if (br_size + size > max_size) {
uprintf(" SBR size is too large - You may need to uncheck 'Add fixes for old BIOSes'.");
if (sub_type == BT_MAX)
safe_free(buf);
return FALSE;
}
@ -1468,9 +1470,12 @@ static void update_progress(const uint64_t processed_bytes)
static int sector_write(int fd, const void* _buf, unsigned int count)
{
const uint8_t* buf = (const uint8_t*)_buf;
const unsigned int sec_size = (unsigned int)SelectedDrive.SectorSize;
unsigned int sec_size = (unsigned int)SelectedDrive.SectorSize;
int written, fill_size = 0;
if (sec_size == 0)
sec_size = 512;
// If we are on a sector boundary and count is multiple of the
// sector size, just issue a regular write
if ((sec_buf_pos == 0) && (count % sec_size == 0))