From 5c888722c0167df5ef2d788f663c7610c5a34ed3 Mon Sep 17 00:00:00 2001 From: Mike Smith Date: Thu, 4 Jul 2002 10:07:02 +0000 Subject: [PATCH] Fix overrun of a buffer resulting in a crash on some input files. svn path=/trunk/vorbis/; revision=3518 --- lib/envelope.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)); } -- 2.7.4