diff options
Diffstat (limited to 'src/input/input_mms.c')
-rw-r--r-- | src/input/input_mms.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/input/input_mms.c b/src/input/input_mms.c index 6a1e729e6..cd88a0609 100644 --- a/src/input/input_mms.c +++ b/src/input/input_mms.c @@ -122,6 +122,13 @@ static buf_element_t *mms_plugin_read_block (input_plugin_t *this_gen, lprintf ("mms_plugin_read_block: %"PRId64" bytes...\n", todo); + 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; @@ -401,7 +408,7 @@ static input_plugin_t *mms_class_get_instance (input_class_t *cls_gen, xine_stre return NULL; } - this = (mms_input_plugin_t *) xine_xmalloc (sizeof (mms_input_plugin_t)); + this = calloc(1, sizeof (mms_input_plugin_t)); cls->ip = this; this->stream = stream; this->mms = NULL; @@ -459,7 +466,7 @@ static void *init_class (xine_t *xine, void *data) { mms_input_class_t *this; - this = (mms_input_class_t *) xine_xmalloc (sizeof (mms_input_class_t)); + this = calloc(1, sizeof (mms_input_class_t)); this->xine = xine; this->ip = NULL; |