summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2006-09-26 21:32:08 +0000
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2006-09-26 21:32:08 +0000
commit7d64e92d753c2c5923b44d96827f2437bebc9d9e (patch)
tree3c243957af5d5d206af767a26bf60cc279261cf8 /src
parent3a8877f973bb74515f3203a0af15c343fc9ae71d (diff)
downloadxine-lib-7d64e92d753c2c5923b44d96827f2437bebc9d9e.tar.gz
xine-lib-7d64e92d753c2c5923b44d96827f2437bebc9d9e.tar.bz2
When there's no plugin to replace, output a log, and skip the plugin entirely, to avoid an off-by-one in decoder_map.
Found by Coverity Scan CID 122. CVS patchset: 8304 CVS date: 2006/09/26 21:32:08
Diffstat (limited to 'src')
-rw-r--r--src/xine-engine/load_plugins.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c
index 8de61a103..a0e245040 100644
--- a/src/xine-engine/load_plugins.c
+++ b/src/xine-engine/load_plugins.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: load_plugins.c,v 1.224 2006/08/12 01:43:26 miguelfreitas Exp $
+ * $Id: load_plugins.c,v 1.225 2006/09/26 21:32:08 dgp85 Exp $
*
*
* Load input/demux/audio_out/video_out/codec plugins
@@ -199,6 +199,13 @@ static void map_decoder_list (xine_t *this,
priority > get_decoder_priority(this, decoder_map[streamtype][pos]))
break;
+ if ( pos == PLUGINS_PER_TYPE ) {
+ xine_log (this, XINE_LOG_PLUGIN,
+ _("map_decoder_list: no space for decoder, skipped.\n"));
+ type++;
+ continue;
+ }
+
/* shift the decoder list for this type by one to make room for new decoder */
for (i = PLUGINS_PER_TYPE - 1; i > pos; i--)
decoder_map[streamtype][i] = decoder_map[streamtype][i - 1];