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.)
This commit is contained in:
Laszlo Ashin 2008-11-08 13:10:15 +01:00 committed by Max Kellermann
parent cfd55b29bd
commit 3e338da871
1 changed files with 6 additions and 2 deletions

View File

@ -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