]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Fix DTS INT64_MIN issue by checking for PTS_UNSET after pts_diff() call
authorcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Mon, 22 Sep 2025 00:28:46 +0000 (00:28 +0000)
committercopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Mon, 22 Sep 2025 00:28:46 +0000 (00:28 +0000)
Co-authored-by: Flole998 <9951871+Flole998@users.noreply.github.com>
src/plumbing/tsfix.c

index 08a4c9498f51c15cbc5f0b50034ace6f3dc810d3..dd393a278cca76ee413ef91bf4598fb7fd3c09d1 100644 (file)
@@ -242,6 +242,12 @@ normalize_ts(tsfix_t *tf, tfstream_t *tfs, th_pkt_t *pkt, int backlog)
   else
     dts = pts_diff(ref, pkt->pkt_dts);
 
+  /* Check for invalid DTS calculation result */
+  if (dts == PTS_UNSET) {
+    tsfix_packet_drop(tfs, pkt, "invalid dts calculation");
+    return;
+  }
+
   if (tfs->tfs_last_dts_norm == PTS_UNSET) {
     if (dts < 0 || pkt->pkt_err) {
       /* Early packet with negative time stamp, drop those */