Opened 18 years ago
Closed 18 years ago
#1194 closed defect (fixed)
PlaybackBox::updateUsage() will crash with floating point exeception
Reported by: | Owned by: | Isaac Richards | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | mythtv | Version: | |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
PlaybackBox::updateUsage() in programs/mythfrontend/playbackbox.cpp will crash with a floatingpoint exception during two conditions:
- The total amount of space left is less than 1024 bytes
- The call to RemoteGetFreeSpace?() doesn't return any info (More likely than the previous in case of backend down for example)
The problem is line 940:
double perc = (double)((double)freeSpaceUsed / (double)freeSpaceTotal);
where freeSpaceTotal should be checked for 0 before usage.
I Would attach a patch, but as it will involve artistic decisions about what to report as usage and freeI think I leave that to the core team.
Note: See
TracTickets for help on using
tickets.
(In [8844]) Fixes #1194. Check for zero before division.