Skip to content

Commit

Permalink
Fix file handle leaks in oggvorbis and wavpack tag readers. These, al…
Browse files Browse the repository at this point in the history
…ong with one in the flac tag reader were caused when we stopped using an instance of the Taglib::FileRef class to read the track length. Taglib::FileRef would take ownership of the pointer and delete it when we were done, now that we're not using Taglib::FileRef we're again responsible for deleting the object which in turn closes the open file handle. Refs #10721

(cherry picked from commit f46b168)
  • Loading branch information
stuartm committed May 30, 2012
1 parent 2144ef1 commit 6ce0af8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mythplugins/mythmusic/mythmusic/metaiooggvorbis.cpp
Expand Up @@ -136,8 +136,8 @@ Metadata* MetaIOOggVorbis::read(const QString &filename)

if (metadata->Length() <= 0)
metadata->setLength(getTrackLength(oggfile));
else
delete oggfile;

delete oggfile;

return metadata;
}
4 changes: 2 additions & 2 deletions mythplugins/mythmusic/mythmusic/metaiowavpack.cpp
Expand Up @@ -118,8 +118,8 @@ Metadata* MetaIOWavPack::read(const QString &filename)

if (metadata->Length() <= 0)
metadata->setLength(getTrackLength(wpfile));
else
delete wpfile;

delete wpfile;

return metadata;
}

0 comments on commit 6ce0af8

Please sign in to comment.