changeset 1553:22f1948c9c28

Merge some changes from XMMS-SID
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 02 Sep 2007 01:30:22 +0300
parents 96f83b3872ea
children f7c630358bda
files src/sid/xs_length.c src/sid/xs_sidplay2.cc src/sid/xs_stil.c
diffstat 3 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/sid/xs_length.c	Sat Sep 01 11:18:52 2007 +0200
+++ b/src/sid/xs_length.c	Sun Sep 02 01:30:22 2007 +0300
@@ -209,8 +209,7 @@
 	lineNum = 0;
 
 	while (fgets(inLine, XS_BUF_SIZE, inFile) != NULL) {
-		size_t linePos;
-		linePos = 0;
+		size_t linePos = 0;
 		lineNum++;
 		
 		xs_findnext(inLine, &linePos);
--- a/src/sid/xs_sidplay2.cc	Sat Sep 01 11:18:52 2007 +0200
+++ b/src/sid/xs_sidplay2.cc	Sun Sep 02 01:30:22 2007 +0300
@@ -204,6 +204,11 @@
 	/* Convert filter */
 	f = &(xs_cfg.sid2Filter);
 	XSDEBUG("using filter '%s', %d points\n", f->name, f->npoints);
+	if (f->npoints > XS_SIDPLAY2_NFPOINTS) {
+		xs_error(_("[SIDPlay2] Invalid number of filter curve points (%d > %d)\n"),
+			f->npoints, XS_SIDPLAY2_NFPOINTS);
+		f->npoints = XS_SIDPLAY2_NFPOINTS;
+	}
 	
 	tmpFilter.points = f->npoints;
 	for (i = 0; i < f->npoints; i++) {
--- a/src/sid/xs_stil.c	Sat Sep 01 11:18:52 2007 +0200
+++ b/src/sid/xs_stil.c	Sun Sep 02 01:30:22 2007 +0300
@@ -160,7 +160,7 @@
 	t_xs_stil_node *tmpNode;
 	gboolean isError, isMulti;
 	gint subEntry;
-	gchar *tmpLine;
+	gchar *tmpLine = inLine;
 	assert(db);
 
 	/* Try to open the file */
@@ -178,8 +178,7 @@
 	subEntry = 0;
 
 	while (!isError && fgets(inLine, XS_BUF_SIZE, inFile) != NULL) {
-		size_t linePos, eolPos;
-		linePos = eolPos = 0;
+		size_t linePos = 0, eolPos = 0;
 		xs_findeol(inLine, &eolPos);
 		inLine[eolPos] = 0;
 		lineNum++;