summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Olivier <molivier@users.sourceforge.net>2006-01-24 22:25:34 +0000
committerMathieu Olivier <molivier@users.sourceforge.net>2006-01-24 22:25:34 +0000
commite0c973e27e4ae8ad3646c0d9ff23efa7a0219334 (patch)
tree0ddeff5a75d85d21060b91f3b705bbdb1cf7b143
parent56e99256b3e8fc8aec6baa7a74094ae2e12656c5 (diff)
downloadxine-lib-e0c973e27e4ae8ad3646c0d9ff23efa7a0219334.tar.gz
xine-lib-e0c973e27e4ae8ad3646c0d9ff23efa7a0219334.tar.bz2
A bit of defensive programming to protect "_x_demux_send_data" and "_x_demux_read_send_data" from negative "size" parameters
CVS patchset: 7843 CVS date: 2006/01/24 22:25:34
-rw-r--r--src/xine-engine/demux.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c
index 75928c6e1..9a7345d42 100644
--- a/src/xine-engine/demux.c
+++ b/src/xine-engine/demux.c
@@ -20,7 +20,7 @@
* Demuxer helper functions
* hide some xine engine details from demuxers and reduce code duplication
*
- * $Id: demux.c,v 1.60 2005/10/30 02:18:35 miguelfreitas Exp $
+ * $Id: demux.c,v 1.61 2006/01/24 22:25:34 molivier Exp $
*/
@@ -525,7 +525,8 @@ void _x_demux_send_data(fifo_buffer_t *fifo, uint8_t *data, int size,
decoder_flags |= BUF_FLAG_FRAME_START;
- while (fifo && size) {
+ _x_assert(size > 0);
+ while (fifo && size > 0) {
buf = fifo->buffer_pool_alloc (fifo);
@@ -570,7 +571,8 @@ int _x_demux_read_send_data(fifo_buffer_t *fifo, input_plugin_t *input,
decoder_flags |= BUF_FLAG_FRAME_START;
- while (fifo && size) {
+ _x_assert(size > 0);
+ while (fifo && size > 0) {
buf = fifo->buffer_pool_alloc (fifo);