From 7d64e92d753c2c5923b44d96827f2437bebc9d9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 26 Sep 2006 21:32:08 +0000 Subject: 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 --- src/xine-engine/load_plugins.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') 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]; -- cgit v1.2.3