# HG changeset patch # User reimar # Date 1233146765 0 # Node ID 1f4b3aaefcd88ff39a30717031a0c9e7a6c09861 # Parent d6d819415c83b993bcf267f497c301c21e39cf39 Avoid a division by 0 when using -oac mp3lame but no audio data actually is encoded. diff -r d6d819415c83 -r 1f4b3aaefcd8 libmpcodecs/ae_lame.c --- a/libmpcodecs/ae_lame.c Wed Jan 28 00:44:48 2009 +0000 +++ b/libmpcodecs/ae_lame.c Wed Jan 28 12:46:05 2009 +0000 @@ -136,6 +136,7 @@ // fixup CBR mp3 audio header: if(!lame_param_vbr) { encoder->stream->h.dwSampleSize=1; + if (encoder->stream->h.dwLength) ((MPEGLAYER3WAVEFORMAT*)(encoder->stream->wf))->nBlockSize= (encoder->stream->size+(encoder->stream->h.dwLength>>1))/encoder->stream->h.dwLength; encoder->stream->h.dwLength=encoder->stream->size;