summaryrefslogtreecommitdiff
path: root/src/input/input_gnome_vfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/input/input_gnome_vfs.c')
-rw-r--r--src/input/input_gnome_vfs.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/input/input_gnome_vfs.c b/src/input/input_gnome_vfs.c
index 0848b9206..cf97074ee 100644
--- a/src/input/input_gnome_vfs.c
+++ b/src/input/input_gnome_vfs.c
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2000-2003 the xine project
* 2002 Bastien Nocera <hadess@hadess.net>
- *
+ *
* This file is part of totem,
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
@@ -121,6 +121,13 @@ gnomevfs_plugin_read_block (input_plugin_t *this_gen, fifo_buffer_t *fifo,
off_t total_bytes;
buf_element_t *buf = fifo->buffer_pool_alloc (fifo);
+ if (todo > buf->max_size)
+ todo = buf->max_size;
+ if (todo < 0) {
+ buf->free_buffer (buf);
+ return NULL;
+ }
+
buf->content = buf->mem;
buf->type = BUF_DEMUX_BLOCK;
@@ -223,7 +230,7 @@ static const char
}
static int
-gnomevfs_plugin_get_optional_data (input_plugin_t *this_gen,
+gnomevfs_plugin_get_optional_data (input_plugin_t *this_gen,
void *data, int data_type)
{
D ("input_gnomevfs: get optional data, type %08x\n", data_type);