In libFLAC 1.2.1 , if the stream decoder callback does not fill completely the supplied buffer, then a sync error is quickly reported by flac. If compiled with --enable-debug, I get an "../../../src/libFLAC/bitreader.c:1074: failed assertion `cbits < 32'"
Bug can be reproduced easily by patch test_libFLAC:
static FLAC__StreamDecoderReadStatus stream_decoder_read_callback_(const FLAC__StreamDecoder *decoder, FLAC__byte buffer, size_t *bytes, void *client_data)
StreamDecoderClientData *dcd = (StreamDecoderClientData*)client_data;
- const size_t requested_bytes = *bytes;
+ size_t requested_bytes = *bytes;
+ if (requested_bytes > 3 && (rand() % 3)==0)
+ requested_bytes = requested_bytes/3;
I am transitionning from flac 1.1.2, so the only thing I am sure is that it used to work in 1.1.2
Platform is Darwin, configure option are:
../configure --with-pic --disable-ogg --disable-asm-optimizations --enable-debug
Julien ( firstname.lastname@example.org )
Log in to post a comment.