Commit 3e338da8 authored by Laszlo Ashin's avatar Laszlo Ashin Committed by Max Kellermann

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.)
parent cfd55b29
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment