From afc70c120e6b08ac550b107d3bc588262551dae5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 29 Dec 2013 17:30:24 +0100 Subject: util/UriUtil: uri_get_suffix() fails if name begins with dot A file called ".jpg" is not a JPEG file with an empty name; it is merely a hidden file. --- src/util/UriUtil.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/util/UriUtil.cxx b/src/util/UriUtil.cxx index 7997bd5c9..2609db2cf 100644 --- a/src/util/UriUtil.cxx +++ b/src/util/UriUtil.cxx @@ -32,7 +32,8 @@ const char * uri_get_suffix(const char *uri) { const char *suffix = strrchr(uri, '.'); - if (suffix == nullptr) + if (suffix == nullptr || suffix == uri || + suffix[-1] == '/' || suffix[-1] == '\\') return nullptr; ++suffix; -- cgit v1.2.3 From e490e5d0ab6f7ab2204329c0280310b33f3a49f4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 8 Jan 2014 19:50:44 +0100 Subject: playlist/pls: don't free stack buffer --- src/playlist/PlsPlaylistPlugin.cxx | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/playlist/PlsPlaylistPlugin.cxx b/src/playlist/PlsPlaylistPlugin.cxx index d44a34cdf..99be3ad35 100644 --- a/src/playlist/PlsPlaylistPlugin.cxx +++ b/src/playlist/PlsPlaylistPlugin.cxx @@ -68,7 +68,6 @@ pls_parser(GKeyFile *keyfile, std::forward_list &songs) FormatError(pls_domain, "Invalid PLS entry %s: '%s'", key, error->message); g_error_free(error); - g_free(key); return; } -- cgit v1.2.3 From fdd76b346171126e143835429a26044a1cbbfb8f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 8 Jan 2014 22:11:00 +0100 Subject: decoder/faad: fix memory leak --- src/decoder/FaadDecoderPlugin.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/decoder/FaadDecoderPlugin.cxx b/src/decoder/FaadDecoderPlugin.cxx index f1dd5a343..9fd20167d 100644 --- a/src/decoder/FaadDecoderPlugin.cxx +++ b/src/decoder/FaadDecoderPlugin.cxx @@ -393,6 +393,7 @@ faad_stream_decode(Decoder &mpd_decoder, InputStream &is) if (!ret) { LogError(error); NeAACDecClose(decoder); + decoder_buffer_free(buffer); return; } @@ -461,6 +462,7 @@ faad_stream_decode(Decoder &mpd_decoder, InputStream &is) /* cleanup */ NeAACDecClose(decoder); + decoder_buffer_free(buffer); } static bool -- cgit v1.2.3