changeset 2379:e146debd1393 trunk

[svn] Check for sz == 0 in vfs_buffered_file_new_from_uri(), return NULL if it's the case.
author hansmi
date Sun, 21 Jan 2007 04:28:28 -0800
parents 440971af5fda
children 825c3715b90f
files ChangeLog src/audacious/vfs_buffered_file.c
diffstat 2 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Jan 21 03:32:36 2007 -0800
+++ b/ChangeLog	Sun Jan 21 04:28:28 2007 -0800
@@ -1,3 +1,11 @@
+2007-01-21 11:32:36 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
+  revision [3766]
+  - touch .depend after blanking it out
+  
+  trunk/mk/objective.mk |    1 +
+  1 file changed, 1 insertion(+)
+
+
 2007-01-21 11:00:31 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
   revision [3764]
   - remove .depend on make clean
--- a/src/audacious/vfs_buffered_file.c	Sun Jan 21 03:32:36 2007 -0800
+++ b/src/audacious/vfs_buffered_file.c	Sun Jan 21 04:28:28 2007 -0800
@@ -188,6 +188,15 @@
 
     sz = vfs_fread(fd->mem, 1, 32768, fd->fd);
 
+    if (!sz)
+    {
+	g_free(fd->mem);
+	g_free(fd);
+	g_free(handle);
+
+	return NULL;
+    }
+
     fd->buffer = vfs_buffer_new(fd->mem, sz);
 
     handle->handle = fd;