From 8b475790cbeeb1cea631c9fac276be8b32370f1a Mon Sep 17 00:00:00 2001 From: Michael Roitzsch Date: Fri, 21 May 2004 19:54:42 +0000 Subject: double-free fix for yuv decoder by Barry Scott CVS patchset: 6576 CVS date: 2004/05/21 19:54:42 --- src/libxinevdec/yuv.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/libxinevdec/yuv.c b/src/libxinevdec/yuv.c index 5847bb90b..aacec69a3 100644 --- a/src/libxinevdec/yuv.c +++ b/src/libxinevdec/yuv.c @@ -21,7 +21,7 @@ * Actually, this decoder just reorganizes chunks of raw YUV data in such * a way that xine can display them. * - * $Id: yuv.c,v 1.32 2004/03/07 22:45:23 jstembridge Exp $ + * $Id: yuv.c,v 1.33 2004/05/21 19:54:42 mroi Exp $ */ #include @@ -94,9 +94,6 @@ static void yuv_decode_data (video_decoder_t *this_gen, if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */ this->stream->video_out->open (this->stream->video_out, this->stream); - if(this->buf) - free(this->buf); - bih = (xine_bmiheader *) buf->content; this->width = (bih->biWidth + 3) & ~0x03; this->height = (bih->biHeight + 3) & ~0x03; @@ -109,8 +106,11 @@ static void yuv_decode_data (video_decoder_t *this_gen, this->progressive = buf->decoder_info[3]; this->top_field_first = buf->decoder_info[4]; - if (this->buf) + if (this->buf) { free (this->buf); + this->buf = NULL; + } + this->bufsize = VIDEOBUFSIZE; this->buf = malloc(this->bufsize); this->size = 0; -- cgit v1.2.3