diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2001-11-19 22:31:35 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2001-11-19 22:31:35 +0000 |
commit | f8cef0eac8b96d0303fa647e45ceb5cae20176d0 (patch) | |
tree | 6158b3c3e6918bfafaa87253ea423a2de5c34570 | |
parent | da2bdc9c2824ecdbcb0bae82e762c44871bc1074 (diff) | |
download | xine-lib-f8cef0eac8b96d0303fa647e45ceb5cae20176d0.tar.gz xine-lib-f8cef0eac8b96d0303fa647e45ceb5cae20176d0.tar.bz2 |
Fix macro buffer leakage
CVS patchset: 1081
CVS date: 2001/11/19 22:31:35
-rw-r--r-- | src/input/read_cache.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/input/read_cache.c b/src/input/read_cache.c index 2ba9318e5..fb9b27a13 100644 --- a/src/input/read_cache.c +++ b/src/input/read_cache.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: read_cache.c,v 1.7 2001/11/17 14:26:38 f1rmb Exp $ + * $Id: read_cache.c,v 1.8 2001/11/19 22:31:35 miguelfreitas Exp $ */ #include <sys/types.h> @@ -204,6 +204,8 @@ buf_element_t *read_cache_read_block (read_cache_t *this, } else { + this->cur_mbuf = NULL; + while (this->mbuf_pool_top==NULL) { pthread_cond_wait (&this->mbuf_pool_not_empty, &this->lock); } @@ -216,6 +218,8 @@ buf_element_t *read_cache_read_block (read_cache_t *this, mbuf->adr = madr; mbuf->ref = 0; mbuf->size_valid = 0; + + this->cur_mbuf = mbuf; if (lseek (this->fd, madr, SEEK_SET) < 0) { fprintf(stderr, "read_cache: can't seek to offset %lld (%s)\n", @@ -231,8 +235,6 @@ buf_element_t *read_cache_read_block (read_cache_t *this, mbuf->size_valid = bytes_read; } - this->cur_mbuf = mbuf; - } else { mbuf = this->cur_mbuf; } |