aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Ashin <kodest@gmail.com>2008-11-08 13:10:15 +0100
committerMax Kellermann <max@duempel.org>2008-11-08 13:10:15 +0100
commit3e338da871f2b472c72ae6b2788937cd2ca0110a (patch)
tree67f9a967d777e249d82305f02f1768516b6991ae /src
parentcfd55b29bde6db1a90f81423e298378a7fd5b618 (diff)
downloadmpd-3e338da871f2b472c72ae6b2788937cd2ca0110a.tar.gz
mpd-3e338da871f2b472c72ae6b2788937cd2ca0110a.tar.xz
mpd-3e338da871f2b472c72ae6b2788937cd2ca0110a.zip
wavpack: check last_byte in push_back_byte() method
At this moment the wavpack lib doesn't use the return value of the push_back function, which has an equivalent meaning of the return value of ungetc(). This is a lucky situation, because so far it simply returned with 1 as a hard coded value. From now on the function will return EOF on error. (This function makes exactly one byte pushable back.)
Diffstat (limited to 'src')
-rw-r--r--src/decoder/wavpack_plugin.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/decoder/wavpack_plugin.c b/src/decoder/wavpack_plugin.c
index 40eca3972..675143753 100644
--- a/src/decoder/wavpack_plugin.c
+++ b/src/decoder/wavpack_plugin.c
@@ -408,8 +408,12 @@ wavpack_input_set_pos_rel(void *id, int32_t delta, int mode)
static int
wavpack_input_push_back_byte(void *id, int c)
{
- wpin(id)->last_byte = c;
- return 1;
+ if (wpin(id)->last_byte == EOF) {
+ wpin(id)->last_byte = c;
+ return c;
+ } else {
+ return EOF;
+ }
}
static uint32_t