summaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
Diffstat (limited to 'src/input')
-rw-r--r--src/input/input_dvb.c4
-rw-r--r--src/input/input_file.c4
-rw-r--r--src/input/input_gnome_vfs.c4
-rw-r--r--src/input/input_http.c4
-rw-r--r--src/input/input_mms.c4
-rw-r--r--src/input/input_net.c4
-rw-r--r--src/input/input_pnm.c4
-rw-r--r--src/input/input_pvr.c4
-rw-r--r--src/input/input_rtp.c4
-rw-r--r--src/input/input_rtsp.c4
-rw-r--r--src/input/input_smb.c4
-rw-r--r--src/input/input_stdin_fifo.c4
12 files changed, 36 insertions, 12 deletions
diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c
index 2c25b9863..065a57b47 100644
--- a/src/input/input_dvb.c
+++ b/src/input/input_dvb.c
@@ -2590,7 +2590,9 @@ static buf_element_t *dvb_plugin_read_block (input_plugin_t *this_gen,
buf_element_t *buf = fifo->buffer_pool_alloc (fifo);
int total_bytes;
- if (todo < 0 || todo > buf->size) {
+ if (todo > buf->max_size)
+ todo = buf->max_size;
+ if (todo < 0) {
buf->free_buffer (buf);
return NULL;
}
diff --git a/src/input/input_file.c b/src/input/input_file.c
index 387b8c4ea..26874db7c 100644
--- a/src/input/input_file.c
+++ b/src/input/input_file.c
@@ -169,7 +169,9 @@ static buf_element_t *file_plugin_read_block (input_plugin_t *this_gen, fifo_buf
file_input_plugin_t *this = (file_input_plugin_t *) this_gen;
buf_element_t *buf = fifo->buffer_pool_alloc (fifo);
- if (todo < 0 || todo > buf->size) {
+ if (todo > buf->max_size)
+ todo = buf->max_size;
+ if (todo < 0) {
buf->free_buffer (buf);
return NULL;
}
diff --git a/src/input/input_gnome_vfs.c b/src/input/input_gnome_vfs.c
index cb0c88877..acb63dcf6 100644
--- a/src/input/input_gnome_vfs.c
+++ b/src/input/input_gnome_vfs.c
@@ -122,7 +122,9 @@ 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 < 0 || todo > buf->size) {
+ if (todo > buf->max_size)
+ todo = buf->max_size;
+ if (todo < 0) {
buf->free_buffer (buf);
return NULL;
}
diff --git a/src/input/input_http.c b/src/input/input_http.c
index 3b87e003d..a4a37c501 100644
--- a/src/input/input_http.c
+++ b/src/input/input_http.c
@@ -474,7 +474,9 @@ static buf_element_t *http_plugin_read_block (input_plugin_t *this_gen, fifo_buf
off_t total_bytes;
buf_element_t *buf = fifo->buffer_pool_alloc (fifo);
- if (todo < 0 || todo > buf->size) {
+ if (todo > buf->max_size)
+ todo = buf->max_size;
+ if (todo < 0) {
buf->free_buffer (buf);
return NULL;
}
diff --git a/src/input/input_mms.c b/src/input/input_mms.c
index 3d06653ea..191d1aed0 100644
--- a/src/input/input_mms.c
+++ b/src/input/input_mms.c
@@ -123,7 +123,9 @@ static buf_element_t *mms_plugin_read_block (input_plugin_t *this_gen,
lprintf ("mms_plugin_read_block: %"PRId64" bytes...\n", todo);
- if (todo < 0 || todo > buf->size) {
+ if (todo > buf->max_size)
+ todo = buf->max_size;
+ if (todo < 0) {
buf->free_buffer (buf);
return NULL;
}
diff --git a/src/input/input_net.c b/src/input/input_net.c
index 964995bf6..a052d5650 100644
--- a/src/input/input_net.c
+++ b/src/input/input_net.c
@@ -292,7 +292,9 @@ static buf_element_t *net_plugin_read_block (input_plugin_t *this_gen,
buf_element_t *buf = fifo->buffer_pool_alloc (fifo);
off_t total_bytes;
- if (todo < 0 || todo > buf->size) {
+ if (todo > buf->max_size)
+ todo = buf->max_size;
+ if (todo < 0) {
buf->free_buffer (buf);
return NULL;
}
diff --git a/src/input/input_pnm.c b/src/input/input_pnm.c
index afb64e3f5..718473819 100644
--- a/src/input/input_pnm.c
+++ b/src/input/input_pnm.c
@@ -98,7 +98,9 @@ static buf_element_t *pnm_plugin_read_block (input_plugin_t *this_gen,
lprintf ("pnm_plugin_read_block: %"PRId64" bytes...\n", todo);
- if (todo < 0 || todo > buf->size) {
+ if (todo > buf->max_size)
+ todo = buf->max_size;
+ if (todo < 0) {
buf->free_buffer (buf);
return NULL;
}
diff --git a/src/input/input_pvr.c b/src/input/input_pvr.c
index feacc0edf..07f5d955d 100644
--- a/src/input/input_pvr.c
+++ b/src/input/input_pvr.c
@@ -1209,7 +1209,9 @@ static buf_element_t *pvr_plugin_read_block (input_plugin_t *this_gen, fifo_buff
}
buf = fifo->buffer_pool_alloc (fifo);
- if (todo < 0 || todo > buf->size) {
+ if (todo > buf->max_size)
+ todo = buf->max_size;
+ if (todo < 0) {
buf->free_buffer(buf);
return NULL;
}
diff --git a/src/input/input_rtp.c b/src/input/input_rtp.c
index 4d1fb43a9..d8822a3e1 100644
--- a/src/input/input_rtp.c
+++ b/src/input/input_rtp.c
@@ -528,7 +528,9 @@ static buf_element_t *rtp_plugin_read_block (input_plugin_t *this_gen,
buf_element_t *buf = fifo->buffer_pool_alloc (fifo);
int total_bytes;
- if (todo < 0 || todo > buf->size) {
+ if (todo > buf->max_size)
+ todo = buf->max_size;
+ if (todo < 0) {
buf->free_buffer (buf);
return NULL;
}
diff --git a/src/input/input_rtsp.c b/src/input/input_rtsp.c
index 0522f555b..0e5af6043 100644
--- a/src/input/input_rtsp.c
+++ b/src/input/input_rtsp.c
@@ -98,7 +98,9 @@ static buf_element_t *rtsp_plugin_read_block (input_plugin_t *this_gen,
lprintf ("rtsp_plugin_read_block: %"PRId64" bytes...\n", todo);
- if (todo < 0 || todo > buf->size) {
+ if (todo > buf->max_size)
+ todo = buf->max_size;
+ if (todo < 0) {
buf->free_buffer (buf);
return NULL;
}
diff --git a/src/input/input_smb.c b/src/input/input_smb.c
index b7c864f50..3c2086cc3 100644
--- a/src/input/input_smb.c
+++ b/src/input/input_smb.c
@@ -92,7 +92,9 @@ smb_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 < 0 || todo > buf->size) {
+ if (todo > buf->max_size)
+ todo = buf->max_size;
+ if (todo < 0) {
buf->free_buffer (buf);
return NULL;
}
diff --git a/src/input/input_stdin_fifo.c b/src/input/input_stdin_fifo.c
index 2797568b6..55ac18a42 100644
--- a/src/input/input_stdin_fifo.c
+++ b/src/input/input_stdin_fifo.c
@@ -124,7 +124,9 @@ static buf_element_t *stdin_plugin_read_block (input_plugin_t *this_gen, fifo_bu
/* stdin_input_plugin_t *this = (stdin_input_plugin_t *) this_gen; */
buf_element_t *buf = fifo->buffer_pool_alloc (fifo);
- if (todo < 0 || todo > buf->size) {
+ if (todo > buf->max_size)
+ todo = buf->max_size;
+ if (todo < 0) {
buf->free_buffer (buf);
return NULL;
}