mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-17 23:36:41 +01:00
Fixed foobar2000 input handling paths greater than 259 bytes in length
This commit is contained in:
parent
b54d0be218
commit
e9b490f3b4
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
#define VERSION "r1004"
|
||||
#define VERSION "r1004.1"
|
||||
|
Loading…
x
Reference in New Issue
Block a user