From e995029cf2809743acc2afbd74d0a53da2b11d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Sun, 7 May 2006 09:37:31 +0000 Subject: [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 --- src/xine-engine/input_rip.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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) { -- cgit v1.2.3