Skip to content

Commit

Permalink
fix invalid C23 in process_frame_thread_ (#649)
Browse files Browse the repository at this point in the history
process_frame_thread_ should return NULL instead of false,
in C23 NULL and _Bool are not compatible and the code is rightfully
rejected by the compiler.

"stream_encoder.c:3595:48: error: incompatible types when returning type
‘_Bool’ but ‘void *’ was expected"
  • Loading branch information
crrodriguez authored Mar 5, 2024
1 parent 4194eb6 commit 0c8afdf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libFLAC/stream_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -3659,7 +3659,7 @@ void * process_frame_thread_(void * args) {
pthread_mutex_unlock(&encoder->private_->mutex_work_queue);
if(!FLAC__MD5Accumulate(&encoder->private_->md5context, (const FLAC__int32 * const *)encoder->private_->md5_fifo.data, encoder->protected_->channels, length, (encoder->protected_->bits_per_sample+7) / 8)) {
encoder->protected_->state = FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR;
return false;
return NULL;
}
pthread_mutex_lock(&encoder->private_->mutex_md5_fifo);
for(channel = 0; channel < encoder->protected_->channels; channel++)
Expand Down

0 comments on commit 0c8afdf

Please sign in to comment.