From 9c116d24e6fea71081bcba25529d405dbe90bc6f Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 28 Jan 2009 12:46:05 +0000 Subject: Avoid a division by 0 when using -oac mp3lame but no audio data actually is encoded. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28382 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ae_lame.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libmpcodecs/ae_lame.c b/libmpcodecs/ae_lame.c index c539d6ba6d..14cdcc6ac1 100644 --- a/libmpcodecs/ae_lame.c +++ b/libmpcodecs/ae_lame.c @@ -136,6 +136,7 @@ static void fixup(audio_encoder_t *encoder) // 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; -- cgit v1.2.3