Skip to content

Commit

Permalink
core: Respect the probe search limit when probing (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
perxjoh committed Jan 15, 2024
1 parent 850b227 commit 3d206b2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions symphonia-core/src/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ impl Probe {

count += 1;

if count > Probe::PROBE_SEARCH_LIMIT {
break;
}

if count % 4096 == 0 {
debug!(
"searching for format marker... {}+{} / {} bytes.",
Expand Down Expand Up @@ -291,8 +295,13 @@ impl Probe {
}
}

// Could not find any marker within the probe limit.
error!("reached probe limit of {} bytes.", Probe::PROBE_SEARCH_LIMIT);
if count < Probe::PROBE_SEARCH_LIMIT {
error!("probe reach EOF at {} bytes.", count);
}
else {
// Could not find any marker within the probe limit.
error!("reached probe limit of {} bytes.", Probe::PROBE_SEARCH_LIMIT);
}

unsupported_error("core (probe): no suitable format reader found")
}
Expand Down

0 comments on commit 3d206b2

Please sign in to comment.