mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-01 18:21:31 -04:00
Minor fixes to limit memory used by wma scanner
This commit is contained in:
parent
fe4742b026
commit
714af4c9ce
@ -438,6 +438,7 @@ int wma_parse_extended_content_description(int fd,int size, MP3FILE *pmp3) {
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
for(index = 0; index < descriptor_count; index++) {
|
for(index = 0; index < descriptor_count; index++) {
|
||||||
|
DPRINTF(E_DBG,L_SCAN,"Reading descr %d of %d\n",index,descriptor_count);
|
||||||
if(!wma_file_read_short(fd,&descriptor_name_len)) return -1;
|
if(!wma_file_read_short(fd,&descriptor_name_len)) return -1;
|
||||||
if(!wma_file_read_utf16(fd,descriptor_name_len,&descriptor_name)) return -1;
|
if(!wma_file_read_utf16(fd,descriptor_name_len,&descriptor_name)) return -1;
|
||||||
if(!wma_file_read_short(fd,&descriptor_value_type)) {
|
if(!wma_file_read_short(fd,&descriptor_value_type)) {
|
||||||
@ -462,9 +463,14 @@ int wma_parse_extended_content_description(int fd,int size, MP3FILE *pmp3) {
|
|||||||
DPRINTF(E_DBG,L_SCAN,"Type: string, value: %s\n",descriptor_byte_value);
|
DPRINTF(E_DBG,L_SCAN,"Type: string, value: %s\n",descriptor_byte_value);
|
||||||
break;
|
break;
|
||||||
case 0x0001: /* byte array */
|
case 0x0001: /* byte array */
|
||||||
if(!wma_file_read_bytes(fd,descriptor_value_len,
|
if(descriptor_value_len > 4096) {
|
||||||
(unsigned char **)&descriptor_byte_value)){
|
lseek(fd,descriptor_value_len,SEEK_CUR);
|
||||||
fail=1;
|
descriptor_byte_value = NULL;
|
||||||
|
} else {
|
||||||
|
if(!wma_file_read_bytes(fd,descriptor_value_len,
|
||||||
|
(unsigned char **)&descriptor_byte_value)){
|
||||||
|
fail=1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
DPRINTF(E_DBG,L_SCAN,"Type: bytes\n");
|
DPRINTF(E_DBG,L_SCAN,"Type: bytes\n");
|
||||||
break;
|
break;
|
||||||
@ -492,6 +498,7 @@ int wma_parse_extended_content_description(int fd,int size, MP3FILE *pmp3) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(fail) {
|
if(fail) {
|
||||||
|
DPRINTF(E_DBG,L_SCAN,"Read fail on file\n");
|
||||||
free(descriptor_name);
|
free(descriptor_name);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ CC=gcc
|
|||||||
CFLAGS := $(CFLAGS) -g -I/opt/local/include -DHAVE_CONFIG_H -I. -I.. -DHOST='"foo"' -DHAVE_SQL -DHAVE_CONFIG_H
|
CFLAGS := $(CFLAGS) -g -I/opt/local/include -DHAVE_CONFIG_H -I. -I.. -DHOST='"foo"' -DHAVE_SQL -DHAVE_CONFIG_H
|
||||||
LDFLAGS := $(LDFLAGS) -L/opt/local/lib -lid3tag -logg -lvorbisfile -lFLAC -lvorbis -ltag_c -lsqlite -lsqlite3 -lm -framework CoreFoundation
|
LDFLAGS := $(LDFLAGS) -L/opt/local/lib -lid3tag -logg -lvorbisfile -lFLAC -lvorbis -ltag_c -lsqlite -lsqlite3 -lm -framework CoreFoundation
|
||||||
TARGET = scanner
|
TARGET = scanner
|
||||||
OBJECTS=scanner-driver.o restart.o err.o scan-aif.o scan-wma.o scan-aac.o scan-wav.o scan-flac.o scan-ogg.o scan-mp3.o scan-url.o scan-mpc.o os-unix.o conf.o ll.o xml-rpc.o webserver.o uici.o rend-win32.o configfile.o db-generic.o db-sql-sqlite3.o db-sql-sqlite2.o db-sql.o smart-parser.o plugin.o dispatch.o dynamic-art.o
|
OBJECTS=scanner-driver.o restart.o err.o scan-aif.o scan-wma.o scan-aac.o scan-wav.o scan-flac.o scan-ogg.o scan-mp3.o scan-url.o scan-mpc.o os-unix.o conf.o ll.o xml-rpc.o webserver.o uici.o rend-win32.o configfile.o db-generic.o db-sql-sqlite3.o db-sql-sqlite2.o db-sql.o smart-parser.o plugin.o dispatch.o dynamic-art.o db-sql-updates.o
|
||||||
|
|
||||||
$(TARGET): $(OBJECTS)
|
$(TARGET): $(OBJECTS)
|
||||||
$(CC) -o $(TARGET) $(LDFLAGS) $(OBJECTS)
|
$(CC) -o $(TARGET) $(LDFLAGS) $(OBJECTS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user