From dec217438b63373fefd6f50c85664f57148efe50 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Mon, 19 Jul 2010 19:56:48 +0100 Subject: Fix a few small memory leaks. --- src/input/pnm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/input') diff --git a/src/input/pnm.c b/src/input/pnm.c index bf24e5f8f..1bbc93fb6 100644 --- a/src/input/pnm.c +++ b/src/input/pnm.c @@ -712,6 +712,7 @@ pnm_t *pnm_connect(xine_stream_t *stream, const char *mrl) { if (strncmp(mrl,"pnm://",6)) { + free (mrl_ptr); return NULL; } -- cgit v1.2.3 From ba6e40bee872673f4af4e32836d633b28e634997 Mon Sep 17 00:00:00 2001 From: Matthias Drochner Date: Wed, 21 Jul 2010 15:10:23 +0000 Subject: Advance buffer pointer after read In dvd_input.c:file_read(), if the read is not done in a single access, the buffer pointer doesn't get advanced so that the second read overwrites the data of the first. I actually don't remember under which circumstances this could happen, but the flaw in the code is obvious. The patch is from NetBSD's pkgsrc, and this patch is attributed to an "unnamed contributor" in the CVS log. --- src/input/libdvdnav/dvd_input.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/input') diff --git a/src/input/libdvdnav/dvd_input.c b/src/input/libdvdnav/dvd_input.c index 7b35f5eef..8eea51412 100644 --- a/src/input/libdvdnav/dvd_input.c +++ b/src/input/libdvdnav/dvd_input.c @@ -319,6 +319,7 @@ static int file_read(dvd_input_t dev, void *buffer, int blocks, int flags) return (int) (bytes / DVD_VIDEO_LB_LEN); } + buffer += ret; len -= ret; } -- cgit v1.2.3 From 99995e9829efc897518c2cf3265dbcac7149c90d Mon Sep 17 00:00:00 2001 From: Matthias Drochner Date: Wed, 21 Jul 2010 15:46:13 +0000 Subject: Add NetBSD support to the VCD input plugin --HG-- extra : rebase_source : cfee1d5353fa3cacf4df8712fde15cd94e2ee3d4 --- src/input/input_vcd.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/input') diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c index 43980bd52..3e65f7203 100644 --- a/src/input/input_vcd.c +++ b/src/input/input_vcd.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #ifdef HAVE_LINUX_CDROM_H @@ -92,7 +93,7 @@ typedef struct { #if defined (__linux__) || defined(__sun) struct cdrom_tochdr tochdr; struct cdrom_tocentry tocent[100]; -#elif defined (__FreeBSD_kernel__) || defined (__OpenBSD__) +#elif (defined(BSD) && BSD >= 199306) struct ioc_toc_header tochdr; struct cd_toc_entry *tocent; off_t cur_sec; @@ -117,7 +118,7 @@ typedef struct { int cur_track; -#if defined (__linux__) || defined(__sun) || defined (__FreeBSD_kernel__) || defined (__OpenBSD__) +#if defined (__linux__) || defined(__sun) || (defined(BSD) && BSD >= 199306) uint8_t cur_min, cur_sec, cur_frame; #endif @@ -177,7 +178,7 @@ static int input_vcd_read_toc (vcd_input_class_t *this, int fd) { return 0; } -#elif defined (__FreeBSD_kernel__) || defined (__OpenBSD__) +#elif (defined(BSD) && BSD >= 199306) static int input_vcd_read_toc (vcd_input_class_t *this, int fd) { struct ioc_read_toc_entry te; @@ -393,7 +394,7 @@ static off_t vcd_plugin_read (input_plugin_t *this_gen, memcpy (buf, data.data, VCDSECTORSIZE); /* FIXME */ return VCDSECTORSIZE; } -#elif defined (__FreeBSD_kernel__) || defined (__OpenBSD__) +#elif (defined(BSD) && BSD >= 199306) static off_t vcd_plugin_read (input_plugin_t *this_gen, char *buf, off_t nlen) { vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen; @@ -531,7 +532,7 @@ static buf_element_t *vcd_plugin_read_block (input_plugin_t *this_gen, memcpy (buf->mem, data.data, VCDSECTORSIZE); /* FIXME */ return buf; } -#elif defined (__FreeBSD_kernel__) || defined (__OpenBSD__) +#elif (defined(BSD) && BSD >= 199306) static buf_element_t *vcd_plugin_read_block (input_plugin_t *this_gen, fifo_buffer_t *fifo, off_t nlen) { @@ -690,7 +691,7 @@ static off_t vcd_plugin_seek (input_plugin_t *this_gen, return offset ; /* FIXME */ } -#elif defined (__FreeBSD_kernel__) || defined (__OpenBSD__) +#elif (defined(BSD) && BSD >= 199306) static off_t vcd_plugin_seek (input_plugin_t *this_gen, off_t offset, int origin) { @@ -764,7 +765,7 @@ static off_t vcd_plugin_get_length (input_plugin_t *this_gen) { return (off_t) 0; } -#elif defined (__FreeBSD_kernel__) || defined (__OpenBSD__) +#elif (defined(BSD) && BSD >= 199306) static off_t vcd_plugin_get_length (input_plugin_t *this_gen) { vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen; off_t len ; @@ -859,7 +860,7 @@ static int vcd_plugin_open (input_plugin_t *this_gen) { this->cur_min = this->cls->tocent[this->cur_track].cdte_addr.msf.minute; this->cur_sec = this->cls->tocent[this->cur_track].cdte_addr.msf.second; this->cur_frame = this->cls->tocent[this->cur_track].cdte_addr.msf.frame; -#elif defined (__OpenBSD__) +#elif defined (__OpenBSD__) || defined(__NetBSD__) this->cur_min = this->cls->tocent[this->cur_track + 1 - this->cls->tochdr.starting_track].addr.msf.minute; this->cur_sec = this->cls->tocent[this->cur_track + 1 - this->cls->tochdr.starting_track].addr.msf.second; this->cur_frame = this->cls->tocent[this->cur_track + 1 - this->cls->tochdr.starting_track].addr.msf.frame; -- cgit v1.2.3