changeset 1263:458d46e65a86

wav-sndfile: in is_our_file, ensure that filename is not NULL before passing it to sf_open
author Giacomo Lozito <james@develia.org>
date Fri, 13 Jul 2007 20:55:42 +0200
parents 0618841906ca
children 5fe8289b9aed
files src/wav/wav-sndfile.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/wav/wav-sndfile.c	Fri Jul 13 12:21:37 2007 -0500
+++ b/src/wav/wav-sndfile.c	Fri Jul 13 20:55:42 2007 +0200
@@ -138,11 +138,14 @@
 	SF_INFO tmp_sfinfo;
 	gchar *filename = g_filename_from_uri(fileuri, NULL, NULL);
 
+	if (filename == NULL)
+		return FALSE;
+
 	/* Have to open the file to see if libsndfile can handle it. */
 	if (! (tmp_sndfile = sf_open (filename, SFM_READ, &tmp_sfinfo))) {
 		g_free(filename);
 		return FALSE;
-    }
+	}
 
 	/* It can so close file and return TRUE. */
 	sf_close (tmp_sndfile);