Skip to content

Commit

Permalink
Don't try to skip link after allocation failure (#752)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmf01 authored Oct 8, 2024
1 parent 00a2708 commit ed4e1c4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libFLAC/stream_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,10 @@ FLAC_API FLAC__bool FLAC__stream_decoder_skip_single_link(FLAC__StreamDecoder *d
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->protected_);

if(!decoder->private_->is_ogg)
if(!decoder->private_->is_ogg ||
decoder->protected_->state == FLAC__STREAM_DECODER_ABORTED ||
decoder->protected_->state == FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR ||
decoder->protected_->state == FLAC__STREAM_DECODER_UNINITIALIZED)
return false;

FLAC__ASSERT_DECLARATION(linknumber_start = decoder->protected_->ogg_decoder_aspect.current_linknumber);
Expand Down

0 comments on commit ed4e1c4

Please sign in to comment.