Opened 11 years ago
Closed 11 years ago
Last modified 11 years ago
#5567 closed defect (fixed)
mythmusic defects
Reported by: | Owned by: | paulh | |
---|---|---|---|
Priority: | minor | Milestone: | 0.22 |
Component: | mythmusic | Version: | head |
Severity: | low | Keywords: | |
Cc: | Ticket locked: | no |
Description
There are various defects in mythmusic. The attached patch attempts to address them all. There is a header to the patch to describe each defect.
Attachments (1)
Change History (4)
Changed 11 years ago by
Attachment: | mythmusic-defects.patch added |
---|
comment:1 Changed 11 years ago by
Milestone: | unknown → 0.22 |
---|---|
Owner: | changed from Isaac Richards to paulh |
Status: | new → assigned |
Erik I assume reverting Daniel's changes in encoder.cpp was a mistake?
The only other change I've made was we might as well use Qt's QDir::home() to get the home directory rather than mess about with environment variables.
comment:2 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
(In [18198]) Various MythMusic defect fixes from Erik Hovland. Fixes #5567.
- By moving the 'return 0;' inside the cpp clause an unreachable defect is not triggered.
- If a parent isn't found then ripTrack could be leaked.
- item declaration hides the item parameter in the member function.
- Declaration of outfile hides parameter in ctor.
- Since the else clause guarantees that the function will end the second 'return -1;' is not necessary. If the else clause is just moved to the end and the extra return removed it has the same effect.
- Using sprintf with getenv is dangerous and could cause the string to be overflowed. Use Qt's QDir::home() function to get the home directory instead.
- m_decoder is the wrong pointer to check. The one to check is the one given by the dyn cast.
- else return missing from conditional clause. Without it there then node could be dereferenced even though it is invalid (and a segfault could happen).
- tmpdata might be null and then dereferenced when getting album and artist.
- Use of tmpnam is dangerous. Using createTempFile from libmyth.
- PLField might be null. Dereferencing it could end in segfault.
- Assignment of item in do/while loop is unnecessary.
- Removal of dead code.
comment:3 Changed 11 years ago by
Erik I assume reverting Daniel's changes in encoder.cpp was a mistake?
Yes, once Daniel's change was reverted the other nonesense I put in was no longer relavent.
Thanks for looking into this one.
Attempts to fix defects in mythmusic