From: Barry S. <bar...@on...> - 2004-05-21 14:41:35
|
This is a cleaner patch and with the diff -u as James requested. I'm using xine-lib rc4 as the base for the diff. It is only nessesary to check for and free the buffer once. I tracked this bug down using dmalloc from dmalloc.com, a nice malloc debugger package. Barry --- src/libxinevdec/yuv.c.bak 2004-05-20 16:27:26.000000000 +0100 +++ src/libxinevdec/yuv.c 2004-05-21 13:56:46.000000000 +0100 @@ -94,9 +94,6 @@ 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 @@ 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; |