From: Mike Smith Date: Thu, 4 Jul 2002 10:07:02 +0000 (+0000) Subject: Fix overrun of a buffer resulting in a crash on some input files. X-Git-Tag: v1.3.3~744 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5c888722c0167df5ef2d788f663c7610c5a34ed3;p=platform%2Fupstream%2Flibvorbis.git Fix overrun of a buffer resulting in a crash on some input files. svn path=/trunk/vorbis/; revision=3518 --- diff --git a/lib/envelope.c b/lib/envelope.c index 4621121..95bb279 100644 --- a/lib/envelope.c +++ b/lib/envelope.c @@ -11,7 +11,7 @@ ******************************************************************** function: PCM data envelope analysis - last mod: $Id: envelope.c,v 1.49 2002/04/06 03:07:25 xiphmont Exp $ + last mod: $Id: envelope.c,v 1.50 2002/07/04 10:07:02 msmith Exp $ ********************************************************************/ @@ -226,7 +226,7 @@ long _ve_envelope_search(vorbis_dsp_state *v){ if(first<0)first=0; /* make sure we have enough storage to match the PCM */ - if(last>ve->storage){ + if(last+VE_WIN+VE_POST>ve->storage){ ve->storage=last+VE_WIN+VE_POST; /* be sure */ ve->mark=_ogg_realloc(ve->mark,ve->storage*sizeof(*ve->mark)); }