diff options
author | Phil Turnbull <phil@semgrep.com> | 2024-02-13 14:45:53 -0500 |
---|---|---|
committer | Phil Turnbull <phil@semgrep.com> | 2024-02-14 11:23:07 -0500 |
commit | c3a5475aafb24eb15ad3a3cf915e8607c0095da1 (patch) | |
tree | 9c2a1f6cecdc2d5aff0f1786b8352c9723f7c720 | |
parent | 1de048630cec0cb9f190fb3e1e9d3c90c669b1bf (diff) |
TagLoaderTagLib: Avoid potential crash when exception is thrown
If `new Ogg::Vorbis::File(stream)` throws an exception then `file` is not
reinitialized and will still point to a deleted object. `file` is used later in
the function which will trigger a use-after-free and potentially crash.
-rw-r--r-- | xbmc/music/tags/TagLoaderTagLib.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/xbmc/music/tags/TagLoaderTagLib.cpp b/xbmc/music/tags/TagLoaderTagLib.cpp index f4f676067a..b6881d5762 100644 --- a/xbmc/music/tags/TagLoaderTagLib.cpp +++ b/xbmc/music/tags/TagLoaderTagLib.cpp @@ -1279,6 +1279,7 @@ bool CTagLoaderTagLib::Load(const std::string& strFileName, CMusicInfoTag& tag, if (!file || !file->isValid()) { delete file; + file = nullptr; oggFlacFile = nullptr; file = oggVorbisFile = new Ogg::Vorbis::File(stream); } |