From 426edade588f6c01a8aa1bcc1cc76601594a1686 Mon Sep 17 00:00:00 2001
From: Francois Cartegnie <fcvlcdev@free.fr>
Date: Thu, 26 Feb 2015 19:26:38 +0100
Subject: [PATCH] demux: ts: fix NULL deref picking PCR (#13996)

Doh!
---
 modules/demux/ts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/demux/ts.c b/modules/demux/ts.c
index d0638988f051..dc459de037c1 100644
--- a/modules/demux/ts.c
+++ b/modules/demux/ts.c
@@ -3045,7 +3045,7 @@ static int FindPCRCandidate( demux_sys_t *p_sys, ts_prg_psi_t *p_prg )
         ts_pid_t *p_pid = &p_sys->pid[i];
         if( p_pid->b_seen && p_pid->es && p_pid->es->id &&
             p_pid->i_owner_number == p_prg->i_number &&
-            p_cand->i_pid != i_previous )
+            (!p_cand || p_cand->i_pid != i_previous) )
         {
             if( p_pid->probed.i_pcr_count ) /* check PCR frequency first */
             {
-- 
GitLab