Skip to content

Commit

Permalink
Don't overwrite abort or out-of-memory with seek error
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmf01 committed Nov 13, 2024
1 parent 0541dd2 commit 431838a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/libFLAC/stream_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -3653,7 +3653,8 @@ FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 s
continue;
}
else {
decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR;
if(decoder->protected_->state != FLAC__STREAM_DECODER_ABORTED && decoder->protected_->state != FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR)
decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR;
return false;
}
}
Expand Down Expand Up @@ -3846,7 +3847,8 @@ FLAC__bool seek_to_absolute_sample_ogg_(FLAC__StreamDecoder *decoder, FLAC__uint
decoder->private_->got_a_frame = false;
if(!FLAC__stream_decoder_process_single(decoder) ||
decoder->protected_->state == FLAC__STREAM_DECODER_ABORTED) {
decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR;
if(decoder->protected_->state != FLAC__STREAM_DECODER_ABORTED && decoder->protected_->state != FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR)
decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR;
return false;
}
if(!decoder->private_->got_a_frame) {
Expand Down

0 comments on commit 431838a

Please sign in to comment.