summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrantišek Dvořák <valtri@users.sourceforge.net>2006-05-07 09:37:31 +0000
committerFrantišek Dvořák <valtri@users.sourceforge.net>2006-05-07 09:37:31 +0000
commite995029cf2809743acc2afbd74d0a53da2b11d56 (patch)
tree287a06452a136dbff557b85eac51904513b9be90 /src
parent3b1dc58073ea3ededb67ca672dedf62b2471590f (diff)
downloadxine-lib-e995029cf2809743acc2afbd74d0a53da2b11d56.tar.gz
xine-lib-e995029cf2809743acc2afbd74d0a53da2b11d56.tar.bz2
[coverity]
Try to fix CID: 38 (Variable "buf" tracked as NULL was dereferenced). I think it's because of not checking for todo < 0. CVS patchset: 7989 CVS date: 2006/05/07 09:37:31
Diffstat (limited to 'src')
-rw-r--r--src/xine-engine/input_rip.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/xine-engine/input_rip.c b/src/xine-engine/input_rip.c
index 6837eb5cf..b03b237fd 100644
--- a/src/xine-engine/input_rip.c
+++ b/src/xine-engine/input_rip.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2004 the xine project
+ * Copyright (C) 2000-2006 the xine project
*
* This file is part of xine, a free video player.
*
@@ -29,7 +29,7 @@
* - it's possible speeder saving streams in the xine without playing:
* xine stream_mrl#save:file.raw\;noaudio\;novideo
*
- * $Id: input_rip.c,v 1.29 2005/02/09 20:03:20 tmattern Exp $
+ * $Id: input_rip.c,v 1.30 2006/05/07 09:37:31 valtri Exp $
*/
/* TODO:
@@ -105,6 +105,8 @@ static off_t rip_plugin_read(input_plugin_t *this_gen, char *buf, off_t len) {
lprintf("reading %lld bytes (curpos = %lld, savepos = %lld)\n", len, this->curpos, this->savepos);
+ if (len < 0) return -1;
+
/* compute sizes and copy data from preview */
if (this->curpos < this->preview_size && this->preview) {
npreview = this->preview_size - this->curpos;
@@ -212,7 +214,7 @@ static buf_element_t *rip_plugin_read_block(input_plugin_t *this_gen, fifo_buffe
lprintf("reading %lld bytes (curpos = %lld, savepos = %lld) (block)\n", todo, this->curpos, this->savepos);
- if (!todo) return NULL;
+ if (todo <= 0) return NULL;
/* compute sizes and copy data from preview */
if (this->curpos < this->preview_size && this->preview) {