Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6e92e3dcfc8f
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 643b260270c9
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Oct 29, 2020

  1. DPhySymbolDecoder: fixed potential out of bound access when interpola…

    …ting edges at time zero
    azonenberg committed Oct 29, 2020
    Copy the full SHA
    643b260 View commit details
Showing with 8 additions and 4 deletions.
  1. +8 −4 scopeprotocols/DPhySymbolDecoder.cpp
12 changes: 8 additions & 4 deletions scopeprotocols/DPhySymbolDecoder.cpp
Original file line number Diff line number Diff line change
@@ -167,13 +167,15 @@ void DPhySymbolDecoder::Refresh()
else if(v > 0.21)
{
//Interpolate the toggle time to sub-sample precision
start += dp->m_timescale * InterpolateTime(dp, i-1, 0.21);
if(i != 0)
start += dp->m_timescale * InterpolateTime(dp, i-1, 0.21);

nextstate = DPhySymbol::STATE_HS1;
}
else if(v < 0.16)
{
start += dp->m_timescale * InterpolateTime(dp, i-1, 0.16);
if(i != 0)
start += dp->m_timescale * InterpolateTime(dp, i-1, 0.16);
nextstate = DPhySymbol::STATE_HS0;
}
}
@@ -214,12 +216,14 @@ void DPhySymbolDecoder::Refresh()
if(vd < -0.05)
{
nextstate = DPhySymbol::STATE_HS0;
start += dp->m_timescale * InterpolateTime(dp, dn, i-1, -0.05);
if(i != 0)
start += dp->m_timescale * InterpolateTime(dp, dn, i-1, -0.05);
}
else if(vd > 0.05)
{
nextstate = DPhySymbol::STATE_HS1;
start += dp->m_timescale * InterpolateTime(dp, dn, i-1, 0.05);
if(i != 0)
start += dp->m_timescale * InterpolateTime(dp, dn, i-1, 0.05);
}
}