fix a bug where missing STREAMINFO fields (min/max framesize, total samples, MD5 sum) and seek point offsets were not getting rewritten back to Ogg FLAC file (SF#1338969 https://sourceforge.net/tracker/index.php?func=detail&aid=1338969&group_id=13478&atid=113478)
diff --git a/src/libFLAC/ogg_helper.c b/src/libFLAC/ogg_helper.c
index 80f7528..d368fca 100644
--- a/src/libFLAC/ogg_helper.c
+++ b/src/libFLAC/ogg_helper.c
@@ -150,7 +150,7 @@
}
}
- page->body_len = 255 * i + page->header[i];
+ page->body_len = 255 * i + page->header[i + OGG_HEADER_FIXED_PORTION_LEN];
}
/* allocate space for the page body */
@@ -199,6 +199,10 @@
encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR;
return false;
}
+ if(write_callback((FLAC__StreamEncoder*)encoder, page->body, page->body_len, 0, 0, client_data) != FLAC__STREAM_ENCODER_WRITE_STATUS_OK) {
+ encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR;
+ return false;
+ }
return true;
}