aboutsummaryrefslogtreecommitdiffstats
path: root/src/filter
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-07-23 12:01:03 +0200
committerMax Kellermann <max@duempel.org>2009-07-23 12:01:03 +0200
commit54889c72e3469027a852d9e8ff029d659e612094 (patch)
tree19864296a3807db7b0384d8052c4b12775c33ba6 /src/filter
parentcba126ceb8f1830614a8df04a6b4c1a45f955417 (diff)
downloadmpd-54889c72e3469027a852d9e8ff029d659e612094.tar.gz
mpd-54889c72e3469027a852d9e8ff029d659e612094.tar.xz
mpd-54889c72e3469027a852d9e8ff029d659e612094.zip
pcm_convert: use GError for error handling
Don't abort the whole MPD process when the conversion fails. This has been a denial-of-service attack vector for years.
Diffstat (limited to 'src/filter')
-rw-r--r--src/filter/convert_filter_plugin.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/filter/convert_filter_plugin.c b/src/filter/convert_filter_plugin.c
index b7f16de4f..d197dbdb9 100644
--- a/src/filter/convert_filter_plugin.c
+++ b/src/filter/convert_filter_plugin.c
@@ -53,12 +53,6 @@ struct convert_filter {
struct pcm_convert_state state;
};
-static inline GQuark
-convert_quark(void)
-{
- return g_quark_from_static_string("pcm_convert");
-}
-
static struct filter *
convert_filter_init(G_GNUC_UNUSED const struct config_param *param,
G_GNUC_UNUSED GError **error_r)
@@ -119,12 +113,10 @@ convert_filter_filter(struct filter *_filter, const void *src, size_t src_size,
dest = pcm_convert(&filter->state, &filter->in_audio_format,
src, src_size,
- &filter->out_audio_format, dest_size_r);
- if (dest == NULL) {
- g_set_error(error_r, convert_quark(), 0,
- "pcm_convert() has failed");
+ &filter->out_audio_format, dest_size_r,
+ error_r);
+ if (dest == NULL)
return NULL;
- }
return dest;
}