Skip to content

Commit ecd50e5

Browse files
tdaedemark4o
authored andcommitted
Fix FLAC read callback for data previously read during probing.
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 <[email protected]>
1 parent 5d0ac20 commit ecd50e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/flac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static FLAC__StreamDecoderReadStatus read_callback(
5656
some more.*/
5757
bytes_to_copy=buflen-bufpos;
5858
bytes_to_copy=*bytes<bytes_to_copy?*bytes:bytes_to_copy;
59-
memcpy(buffer,flac->oldbuf,bytes_to_copy);
59+
memcpy(buffer,flac->oldbuf+flac->bufpos,bytes_to_copy);
6060
flac->bufpos+=bytes_to_copy;
6161
*bytes=bytes_to_copy;
6262
}else{

0 commit comments

Comments
 (0)