Stop processing subframes when invalid data is found

This fixes https://github.com/xiph/flac/issues/580

The problem was that after encountering a problem in a first
subframe, the state was changed from READ_FRAME to
SEARCH_FOR_FRAME_SYNC, which meant a problem in the second
subframe was interpreted as a read error instead of invalid data.

With this patch, processing of subframes is stopped after setting
SEARCH_FOR_FRAME_SYNC
This commit is contained in:
Martijn van Beurden 2023-04-26 11:08:28 +02:00
parent c623f0f42c
commit c65ef58924
1 changed files with 2 additions and 0 deletions

View File

@ -2095,6 +2095,8 @@ FLAC__bool read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame, FL
else
return false;
}
if(decoder->protected_->state != FLAC__STREAM_DECODER_READ_FRAME)
break;
}
if(decoder->protected_->state != FLAC__STREAM_DECODER_END_OF_STREAM)