Commit e771e7b6 authored by Erik de Castro Lopo's avatar Erik de Castro Lopo
Browse files

flac/foreign_metadata: Fix for odd RIFF chunk size

Accept odd values to ckSize of RIFF chunk. FLAC should read these
but should avoid creating them.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
Closes: https://sourceforge.net/p/flac/support-requests/152/
Closes: https://sourceforge.net/p/flac/bugs/419/
parent 5ff15bdd
......@@ -198,8 +198,11 @@ static FLAC__bool read_from_wave_(foreign_metadata_t *fm, FILE *f, const char **
}
if(!append_block_(fm, offset, 12, error))
return false;
if(!fm->is_rf64 || unpack32le_(buffer+4) != 0xffffffffu)
if(!fm->is_rf64 || unpack32le_(buffer+4) != 0xffffffffu) {
eof_offset = (FLAC__off_t)8 + (FLAC__off_t)unpack32le_(buffer+4);
if(eof_offset & 1) /* fix odd RIFF size */
eof_offset++;
}
while(!feof(f)) {
FLAC__uint32 size;
if((offset = ftello(f)) < 0) {
......
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