Mercurial > audlegacy
comparison src/audacious/vfs_buffered_file.c @ 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 | 6c5d4d28cc6b |
children | d41965d1806a |
comparison
equal
deleted
inserted
replaced
2378:440971af5fda | 2379:e146debd1393 |
---|---|
186 return NULL; | 186 return NULL; |
187 } | 187 } |
188 | 188 |
189 sz = vfs_fread(fd->mem, 1, 32768, fd->fd); | 189 sz = vfs_fread(fd->mem, 1, 32768, fd->fd); |
190 | 190 |
191 if (!sz) | |
192 { | |
193 g_free(fd->mem); | |
194 g_free(fd); | |
195 g_free(handle); | |
196 | |
197 return NULL; | |
198 } | |
199 | |
191 fd->buffer = vfs_buffer_new(fd->mem, sz); | 200 fd->buffer = vfs_buffer_new(fd->mem, sz); |
192 | 201 |
193 handle->handle = fd; | 202 handle->handle = fd; |
194 handle->base = &buffered_file_const; | 203 handle->base = &buffered_file_const; |
195 | 204 |