<div>Patch enclosed. Fixes segfault in user's Harry Potter and the Sorcerer's Stone BD at start of playback. ii was being decremented to -1 and caused a segfault in </div><div><br></div><div>spn = (entry->coarse[ii].spn_ep & ~0x1FFFF) + entry->fine[jj].spn_ep;</div>
<div><br></div><div>(currently line 441)</div><div><br></div><div>---</div><div> src/libbluray/bdnav/clpi_parse.c | 2 +-</div><div> 1 files changed, 1 insertions(+), 1 deletions(-)</div><div><br></div><div>diff --git a/src/libbluray/bdnav/clpi_parse.c b/src/libbluray/bdnav/clpi_parse.c</div>
<div>index 9bca392..68d5cdb 100644</div><div>--- a/src/libbluray/bdnav/clpi_parse.c</div><div>+++ b/src/libbluray/bdnav/clpi_parse.c</div><div>@@ -377,7 +377,7 @@ clpi_lookup_spn(CLPI_CL *cl, uint32_t timestamp, int before, uint8_t stc_id)</div>
<div> }</div><div> pts = ((uint64_t)(entry->coarse[ii].pts_ep & ~0x01) << 18) +</div><div> ((uint64_t)entry->fine[ref].pts_ep << 8);</div><div>- if (pts > timestamp) {</div><div>
+ if (pts > timestamp && ii) {</div><div> // The starting point and desired PTS is in the previous coarse entry</div><div> ii--;</div><div> coarse_pts = (uint32_t)(entry->coarse[ii].pts_ep & ~0x01) << 18;</div>
<div>-- </div><div>1.7.0.4</div><div><br></div>