else {
if(!memcmp(lookahead, "ID3", 3)) {
flac__utils_printf(stderr, 1, "ERROR: input file %s has an ID3v2 tag\n", infilename);
+ conditional_fclose(encode_infile);
return 1;
}
else if(!memcmp(lookahead, "RIFF", 4) && !memcmp(lookahead+8, "WAVE", 4))
if(0 == encode_options.format_options.iff.foreign_metadata) {
flac__utils_printf(stderr, 1, "ERROR: creating foreign metadata object\n");
conditional_fclose(encode_infile);
+ if(internal_outfilename != 0)
+ free(internal_outfilename);
return 1;
}
}
if(fwrite(picture->data.picture.data, 1, len, f) != len) {
fprintf(stderr, "%s: ERROR: writing PICTURE data to file\n", filename);
+ if(f != stdout)
+ fclose(f);
return false;
}
FILE *file = fopen(filename, "r+b");
if(0 == file)
return false; /*@@@@ chain status still says OK though */
- if(!chain.write(use_padding, (::FLAC__IOHandle)file, callbacks))
+ if(!chain.write(use_padding, (::FLAC__IOHandle)file, callbacks)) {
+ fclose(file);
return false;
+ }
fclose(file);
}
}