Skip to content

Commit

Permalink
Fix FLAC read callback for data previously read during probing.
Browse files Browse the repository at this point in the history
This was not encountered before because libflac happened to
always request at least 4 bytes for the first read callback.

Fixes #71

Signed-off-by: Mark Harris <mark.hsj@gmail.com>
  • Loading branch information
tdaede authored and mark4o committed May 23, 2022
1 parent 5d0ac20 commit ecd50e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/flac.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static FLAC__StreamDecoderReadStatus read_callback(
some more.*/
bytes_to_copy=buflen-bufpos;
bytes_to_copy=*bytes<bytes_to_copy?*bytes:bytes_to_copy;
memcpy(buffer,flac->oldbuf,bytes_to_copy);
memcpy(buffer,flac->oldbuf+flac->bufpos,bytes_to_copy);
flac->bufpos+=bytes_to_copy;
*bytes=bytes_to_copy;
}else{
Expand Down

0 comments on commit ecd50e5

Please sign in to comment.