MP3: Fix infinite loop

This commit is contained in:
Serial 2022-05-10 19:15:15 -04:00
parent 5b9b97784a
commit 3788a436af
No known key found for this signature in database
GPG key ID: DA95198DC17C4568

View file

@ -54,10 +54,7 @@ pub(super) fn rev_search_for_frame_sync<R>(input: &mut R) -> std::io::Result<Opt
where
R: Read + Seek,
{
let res = input.seek(SeekFrom::Current(REV_FRAME_SEARCH_BOUNDS.neg()));
if res.is_err() {
return Ok(None);
}
input.seek(SeekFrom::Current(REV_FRAME_SEARCH_BOUNDS.neg()))?;
let ret = search_for_frame_sync(&mut input.take(REV_FRAME_SEARCH_BOUNDS as u64));
if let Ok(Some(_)) = ret {