Commit 530514ac authored by Josh Coalson's avatar Josh Coalson
Browse files

fix bug skipping padding byte in unsupported WAVE subchunks

parent 83dd4ce7
......@@ -894,11 +894,11 @@ int flac__encode_wav(FILE *infile, long infilesize, const char *infilename, cons
unsigned long skip = xx+(xx & 1U);
FLAC__ASSERT(skip<=LONG_MAX);
if(fseek(infile, xx, SEEK_CUR) < 0) {
if(fseek(infile, skip, SEEK_CUR) < 0) {
/* can't seek input, read ahead manually... */
unsigned left, need;
const unsigned chunk = sizeof(ucbuffer_);
for(left = xx; left > 0; ) {
for(left = skip; left > 0; ) {
need = min(left, chunk);
if(fread(ucbuffer_, 1, need, infile) < need) {
flac__utils_printf(stderr, 1, "%s: ERROR during read while skipping unsupported sub-chunk\n", encoder_session.inbasefilename);
......
Supports Markdown
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