Fixed foobar2000 input handling paths greater than 259 bytes in length

This commit is contained in:
Chris Moeller 2013-05-26 20:08:54 -07:00
parent b54d0be218
commit e9b490f3b4
3 changed files with 10 additions and 4 deletions

View File

@ -7,7 +7,7 @@ typedef struct _FOO_STREAMFILE {
struct _STREAMFILE sf;
abort_callback * p_abort;
service_ptr_t<file> m_file;
char name[260];
char * name;
off_t offset;
size_t validsize;
uint8_t * buffer;

View File

@ -149,12 +149,13 @@ static off_t get_offset_foo(FOO_STREAMFILE *streamFile) {
static void close_foo(FOO_STREAMFILE * streamfile) {
streamfile->m_file.release();
free(streamfile->name);
free(streamfile->buffer);
free(streamfile);
}
static void get_name_foo(FOO_STREAMFILE *streamfile,char *buffer,size_t length) {
strcpy(buffer,streamfile->name);
strcpy_s(buffer,length,streamfile->name);
}
static STREAMFILE * open_foo_streamfile_buffer_by_file(service_ptr_t<file> m_file,const char * const filename, size_t buffersize, abort_callback * p_abort) {
@ -188,7 +189,12 @@ static STREAMFILE * open_foo_streamfile_buffer_by_file(service_ptr_t<file> m_fil
streamfile->buffer = buffer;
streamfile->p_abort = p_abort;
strcpy(streamfile->name,filename);
streamfile->name = strdup(filename);
if (!streamfile->name) {
free(streamfile);
free(buffer);
return NULL;
}
return &streamfile->sf;
}

View File

@ -1 +1 @@
#define VERSION "r1004"
#define VERSION "r1004.1"