- Fix some memory and resources leak. - Link shared libraries with -Bsymbolic-functions - annotate relevant functions with proper attributes to allow the compiler generate better code (attribute hot. alloc_size) OBS-URL: https://build.opensuse.org/request/show/101855 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/flac?expand=0&rev=21
71 lines
2.9 KiB
Diff
71 lines
2.9 KiB
Diff
--- src/libFLAC/metadata_iterators.c.orig
|
|
+++ src/libFLAC/metadata_iterators.c
|
|
@@ -1217,6 +1217,7 @@ static FLAC__bool chain_read_cb_(FLAC__M
|
|
}
|
|
|
|
if(!read_metadata_block_header_cb_(handle, read_cb, &is_last, &type, &length)) {
|
|
+ node_delete_(node);
|
|
chain->status = FLAC__METADATA_CHAIN_STATUS_READ_ERROR;
|
|
return false;
|
|
}
|
|
@@ -1412,11 +1413,13 @@ static FLAC__bool chain_rewrite_file_(FL
|
|
if(!open_tempfile_(chain->filename, tempfile_path_prefix, &tempfile, &tempfilename, &status)) {
|
|
chain->status = get_equivalent_status_(status);
|
|
cleanup_tempfile_(&tempfile, &tempfilename);
|
|
+ fclose(f);
|
|
return false;
|
|
}
|
|
if(!copy_n_bytes_from_file_(f, tempfile, chain->first_offset, &status)) {
|
|
chain->status = get_equivalent_status_(status);
|
|
cleanup_tempfile_(&tempfile, &tempfilename);
|
|
+ fclose(f);
|
|
return false;
|
|
}
|
|
|
|
@@ -1424,10 +1427,14 @@ static FLAC__bool chain_rewrite_file_(FL
|
|
for(node = chain->head; node; node = node->next) {
|
|
if(!write_metadata_block_header_(tempfile, &status, node->data)) {
|
|
chain->status = get_equivalent_status_(status);
|
|
+ cleanup_tempfile_(&tempfile, &tempfilename);
|
|
+ fclose(f);
|
|
return false;
|
|
}
|
|
if(!write_metadata_block_data_(tempfile, &status, node->data)) {
|
|
chain->status = get_equivalent_status_(status);
|
|
+ cleanup_tempfile_(&tempfile, &tempfilename);
|
|
+ fclose(f);
|
|
return false;
|
|
}
|
|
}
|
|
@@ -1437,10 +1444,12 @@ static FLAC__bool chain_rewrite_file_(FL
|
|
if(0 != fseeko(f, chain->last_offset, SEEK_SET)) {
|
|
cleanup_tempfile_(&tempfile, &tempfilename);
|
|
chain->status = FLAC__METADATA_CHAIN_STATUS_SEEK_ERROR;
|
|
+ fclose(f);
|
|
return false;
|
|
}
|
|
if(!copy_remaining_bytes_from_file_(f, tempfile, &status)) {
|
|
cleanup_tempfile_(&tempfile, &tempfilename);
|
|
+ fclose(f);
|
|
chain->status = get_equivalent_status_(status);
|
|
return false;
|
|
}
|
|
--- src/libFLAC/stream_encoder.c.orig
|
|
+++ src/libFLAC/stream_encoder.c
|
|
@@ -1004,10 +1004,12 @@ static FLAC__StreamEncoderInitStatus ini
|
|
/*
|
|
* Now set up a stream decoder for verification
|
|
*/
|
|
- encoder->private_->verify.decoder = FLAC__stream_decoder_new();
|
|
if(0 == encoder->private_->verify.decoder) {
|
|
- encoder->protected_->state = FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR;
|
|
- return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR;
|
|
+ encoder->private_->verify.decoder = FLAC__stream_decoder_new();
|
|
+ if(0 == encoder->private_->verify.decoder) {
|
|
+ encoder->protected_->state = FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR;
|
|
+ return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR;
|
|
+ }
|
|
}
|
|
|
|
if(FLAC__stream_decoder_init_stream(encoder->private_->verify.decoder, verify_read_callback_, /*seek_callback=*/0, /*tell_callback=*/0, /*length_callback=*/0, /*eof_callback=*/0, verify_write_callback_, verify_metadata_callback_, verify_error_callback_, /*client_data=*/encoder) != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
|