mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-15 16:48:22 -04:00
Handle short file errors better
This commit is contained in:
parent
b50617d356
commit
b033952af2
@ -1527,7 +1527,7 @@ int scan_get_mp3fileinfo(char *file, MP3FILE *pmp3) {
|
|||||||
if(fread(buffer,1,sizeof(buffer),infile) < sizeof(buffer)) {
|
if(fread(buffer,1,sizeof(buffer),infile) < sizeof(buffer)) {
|
||||||
DPRINTF(E_LOG,L_SCAN,"Short read: %s\n",file);
|
DPRINTF(E_LOG,L_SCAN,"Short read: %s\n",file);
|
||||||
fclose(infile);
|
fclose(infile);
|
||||||
break;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
index=0;
|
index=0;
|
||||||
@ -1565,7 +1565,12 @@ int scan_get_mp3fileinfo(char *file, MP3FILE *pmp3) {
|
|||||||
found=1;
|
found=1;
|
||||||
fp_size += index;
|
fp_size += index;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
DPRINTF(E_LOG,L_SCAN,"Could not read frame header: %s\n",file);
|
||||||
|
fclose(infile);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!found) {
|
if(!found) {
|
||||||
DPRINTF(E_DBG,L_SCAN,"Didn't pan out.\n");
|
DPRINTF(E_DBG,L_SCAN,"Didn't pan out.\n");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user