From 910346b87bc6b0ec88f33c054f05dcd96cddbf78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Mon, 21 Nov 2005 10:29:57 +0000 Subject: *BUGFIX* Made win32 decoder wrapper happy with valgrind, prevented reading from freed memory. CVS patchset: 7808 CVS date: 2005/11/21 10:29:57 --- src/libw32dll/w32codec.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/libw32dll/w32codec.c') diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c index d18c05383..1823c9c79 100644 --- a/src/libw32dll/w32codec.c +++ b/src/libw32dll/w32codec.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: w32codec.c,v 1.148 2005/05/15 00:12:44 miguelfreitas Exp $ + * $Id: w32codec.c,v 1.149 2005/11/21 10:29:57 valtri Exp $ * * routines for using w32 codecs * DirectShow support by Miguel Freitas (Nov/2001) @@ -1273,18 +1273,18 @@ static int w32a_init_audio (w32a_decoder_t *this, xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "w32codec: Recommended source buffer size: %d\n", this->rec_audio_src_size); - if( this->buf ) - free(this->buf); - - if( this->outbuf ) - free(this->outbuf); - if( this->rec_audio_src_size < in_fmt->nBlockAlign ) { this->rec_audio_src_size = in_fmt->nBlockAlign; xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "w32codec: adjusting source buffer size to %d\n", this->rec_audio_src_size); } + if( this->buf ) + free(this->buf); + + if( this->outbuf ) + free(this->outbuf); + this->max_audio_src_size = 2 * this->rec_audio_src_size; this->buf = malloc( this->max_audio_src_size ); -- cgit v1.2.3