Mercurial > audlegacy-plugins
comparison src/wav/wav-sndfile.c @ 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 | 5e41a7affccb |
children | 5fe8289b9aed |
comparison
equal
deleted
inserted
replaced
1262:0618841906ca | 1263:458d46e65a86 |
---|---|
136 { | 136 { |
137 SNDFILE *tmp_sndfile; | 137 SNDFILE *tmp_sndfile; |
138 SF_INFO tmp_sfinfo; | 138 SF_INFO tmp_sfinfo; |
139 gchar *filename = g_filename_from_uri(fileuri, NULL, NULL); | 139 gchar *filename = g_filename_from_uri(fileuri, NULL, NULL); |
140 | 140 |
141 if (filename == NULL) | |
142 return FALSE; | |
143 | |
141 /* Have to open the file to see if libsndfile can handle it. */ | 144 /* Have to open the file to see if libsndfile can handle it. */ |
142 if (! (tmp_sndfile = sf_open (filename, SFM_READ, &tmp_sfinfo))) { | 145 if (! (tmp_sndfile = sf_open (filename, SFM_READ, &tmp_sfinfo))) { |
143 g_free(filename); | 146 g_free(filename); |
144 return FALSE; | 147 return FALSE; |
145 } | 148 } |
146 | 149 |
147 /* It can so close file and return TRUE. */ | 150 /* It can so close file and return TRUE. */ |
148 sf_close (tmp_sndfile); | 151 sf_close (tmp_sndfile); |
149 tmp_sndfile = NULL; | 152 tmp_sndfile = NULL; |
150 g_free(filename); | 153 g_free(filename); |