Commit 0b3f79b1 authored by Michael Smith's avatar Michael Smith

Fix two really nasty bugs:

one meant the initial header sizes were completely wrong, the other caused
setting an explicit output filename to enable raw mode.

svn path=/trunk/vorbis-tools/; revision=3724
parent 6e5998b1
......@@ -99,6 +99,7 @@ static void parse_options(int argc, char **argv)
break;
case 'o':
outfilename = strdup(optarg);
break;
case 'R':
raw = 1;
break;
......@@ -126,8 +127,8 @@ int write_prelim_header(OggVorbis_File *vf, FILE *out, ogg_int64_t knownlength)
int align = channels*bits/8;
int samplesize = bits;
if(knownlength)
size = (unsigned int)knownlength;
if(knownlength && knownlength*bits/8*channels < size)
size = (unsigned int)knownlength*bits/8*channels;
memcpy(headbuf, "RIFF", 4);
WRITE_U32(headbuf+4, size-8);
......
Markdown is supported
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