Commits

Anonymous committed 7ef2c4f

* Fix segfault when specified artwork file doesn't exist
* Give up if artwork file can't be found rather than trying to continue

Comments (0)

Files changed (2)

 		copied onto the atom.
 ----------------------*/
 void APar_MetaData_atomArtwork_Init(short atom_num, const char* artworkPath) {
-	TestFileExistence(artworkPath, false);
+	TestFileExistence(artworkPath, true);
 	off_t picture_size = findFileSize(artworkPath);
 	
 	if (picture_size > 0) {
 		fprintf(stderr, "AtomicParsley error: can't open %s for reading: %s\n", filePath, strerror(errno));
 		exit(1);
 	} else {
-		fclose(a_file);
+		if(a_file == NULL) {
+			fprintf(stderr, "AtomicParsley warning: can't open %s for reading but continuing anyway: %s\n", filePath, strerror(errno));
+		} else {
+			fclose(a_file);
+		}
 	}
 }