mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
Fix building when configured with --disable-shared.
The problem was that the function safe_malloc_mul_2op_() was originally defined as static inline in inclide/share/alloc.h but had to be moved because GCC was refusing to inline it. Once moved however, static linking would fail when building the flac executable because the function ended up beiong linked twice.
This commit is contained in:
@@ -966,7 +966,7 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_(
|
||||
*/
|
||||
encoder->private_->verify.input_fifo.size = encoder->protected_->blocksize+OVERREAD_;
|
||||
for(i = 0; i < encoder->protected_->channels; i++) {
|
||||
if(0 == (encoder->private_->verify.input_fifo.data[i] = safe_malloc_mul_2op_(sizeof(FLAC__int32), /*times*/encoder->private_->verify.input_fifo.size))) {
|
||||
if(0 == (encoder->private_->verify.input_fifo.data[i] = safe_malloc_mul_2op_p(sizeof(FLAC__int32), /*times*/encoder->private_->verify.input_fifo.size))) {
|
||||
encoder->protected_->state = FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR;
|
||||
return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR;
|
||||
}
|
||||
@@ -1707,7 +1707,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_metadata(FLAC__StreamEncoder *encod
|
||||
}
|
||||
if(num_blocks) {
|
||||
FLAC__StreamMetadata **m;
|
||||
if(0 == (m = safe_malloc_mul_2op_(sizeof(m[0]), /*times*/num_blocks)))
|
||||
if(0 == (m = safe_malloc_mul_2op_p(sizeof(m[0]), /*times*/num_blocks)))
|
||||
return false;
|
||||
memcpy(m, metadata, sizeof(m[0]) * num_blocks);
|
||||
encoder->protected_->metadata = m;
|
||||
|
||||
Reference in New Issue
Block a user