aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_resample.h
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/pcm_resample.h
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 '')
-rw-r--r--src/pcm_resample.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/pcm_resample.h b/src/pcm_resample.h
index 44720f7b2..9d03bbfbf 100644
--- a/src/pcm_resample.h
+++ b/src/pcm_resample.h
@@ -48,7 +48,7 @@ struct pcm_resample_state {
uint8_t channels;
} prev;
- bool error;
+ int error;
#endif
struct pcm_buffer buffer;
@@ -82,8 +82,8 @@ pcm_resample_16(struct pcm_resample_state *state,
uint8_t channels,
unsigned src_rate,
const int16_t *src_buffer, size_t src_size,
- unsigned dest_rate,
- size_t *dest_size_r);
+ unsigned dest_rate, size_t *dest_size_r,
+ GError **error_r);
/**
* Resamples 32 bit PCM data.
@@ -102,8 +102,8 @@ pcm_resample_32(struct pcm_resample_state *state,
uint8_t channels,
unsigned src_rate,
const int32_t *src_buffer, size_t src_size,
- unsigned dest_rate,
- size_t *dest_size_r);
+ unsigned dest_rate, size_t *dest_size_r,
+ GError **error_r);
/**
* Resamples 24 bit PCM data.
@@ -122,14 +122,14 @@ pcm_resample_24(struct pcm_resample_state *state,
uint8_t channels,
unsigned src_rate,
const int32_t *src_buffer, size_t src_size,
- unsigned dest_rate,
- size_t *dest_size_r)
+ unsigned dest_rate, size_t *dest_size_r,
+ GError **error_r)
{
/* reuse the 32 bit code - the resampler code doesn't care if
the upper 8 bits are actually used */
return pcm_resample_32(state, channels,
src_rate, src_buffer, src_size,
- dest_rate, dest_size_r);
+ dest_rate, dest_size_r, error_r);
}
#endif