comparison src/wav/wav-sndfile.c @ 1264:5fe8289b9aed

a bunch of paranoid checks for the return value of g_filename_from_uri
author Giacomo Lozito <james@develia.org>
date Fri, 13 Jul 2007 21:31:17 +0200
parents 458d46e65a86
children ef8c6b02bdf7
comparison
equal deleted inserted replaced
1263:458d46e65a86 1264:5fe8289b9aed
231 { 231 {
232 gchar *filename = g_filename_from_uri(playback->filename, NULL, NULL); 232 gchar *filename = g_filename_from_uri(playback->filename, NULL, NULL);
233 int pcmbitwidth; 233 int pcmbitwidth;
234 gchar *song_title; 234 gchar *song_title;
235 235
236 if (filename == NULL)
237 return;
238
236 if (sndfile) 239 if (sndfile)
237 return; 240 return;
238 241
239 pcmbitwidth = 32; 242 pcmbitwidth = 32;
240 243
311 314
312 static void 315 static void
313 get_song_info (char *fileuri, char **title, int *length) 316 get_song_info (char *fileuri, char **title, int *length)
314 { 317 {
315 gchar *filename = g_filename_from_uri(fileuri, NULL, NULL); 318 gchar *filename = g_filename_from_uri(fileuri, NULL, NULL);
319 if (filename == NULL)
320 return;
316 (*length) = get_song_length(filename); 321 (*length) = get_song_length(filename);
317 (*title) = get_title(filename); 322 (*title) = get_title(filename);
318 g_free(filename); 323 g_free(filename);
319 } 324 }
320 325