mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-12 15:33:23 -05:00
Fix for bad seeks on wma subheaders
This commit is contained in:
parent
c594cb1ab2
commit
e878464716
@ -348,6 +348,7 @@ int wma_parse_header_extension(int fd, int size, MP3FILE *pmp3) {
|
|||||||
WMA_SUBHEADER sh;
|
WMA_SUBHEADER sh;
|
||||||
WMA_GUID *pguid;
|
WMA_GUID *pguid;
|
||||||
long bytes_left;
|
long bytes_left;
|
||||||
|
off_t current;
|
||||||
|
|
||||||
if(r_read(fd,&he,sizeof(he)) != sizeof(he))
|
if(r_read(fd,&he,sizeof(he)) != sizeof(he))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -357,6 +358,8 @@ int wma_parse_header_extension(int fd, int size, MP3FILE *pmp3) {
|
|||||||
|
|
||||||
while(bytes_left) {
|
while(bytes_left) {
|
||||||
/* read in a subheader */
|
/* read in a subheader */
|
||||||
|
current = lseek(fd,0,SEEK_CUR);
|
||||||
|
|
||||||
if(r_read(fd,&sh,sizeof(sh)) != sizeof(sh))
|
if(r_read(fd,&sh,sizeof(sh)) != sizeof(sh))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
@ -383,12 +386,14 @@ int wma_parse_header_extension(int fd, int size, MP3FILE *pmp3) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DPRINTF(E_DBG,L_SCAN," Size: %ld\n",sh.size);
|
DPRINTF(E_DBG,L_SCAN," Size: %ld\n",sh.size);
|
||||||
|
if(sh.size <= sizeof(sh))
|
||||||
|
return TRUE; /* guess we're done! */
|
||||||
|
|
||||||
bytes_left -= sh.size;
|
bytes_left -= sh.size;
|
||||||
lseek(fd,sh.size - sizeof(sh),SEEK_CUR);
|
lseek(fd,current + sh.size,SEEK_SET);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user