From 505f20dbb080ff4d845aee5d1f42872d818cf992 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 25 Jun 2021 12:33:58 -0400 Subject: [PATCH] TT#14008 fix possible null pointer reference closes #1293 Change-Id: I3c503d654cdbd90a1b5fb80bf3bc518b810b4ad5 (cherry picked from commit 9b6c69e5244a707a8ea61fbfc7789707606eaf84) --- daemon/codec.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/daemon/codec.c b/daemon/codec.c index 289e13e7a..6f4e2e433 100644 --- a/daemon/codec.c +++ b/daemon/codec.c @@ -1796,11 +1796,13 @@ static int __handler_func_sequencer(struct media_packet *mp, struct transcode_pa } h = packet->handler; - obj_put(&ch->h); - ch = get_ssrc(ssrc_in_p->h.ssrc, h->ssrc_hash); - if (G_UNLIKELY(!ch)) + struct codec_ssrc_handler *next_ch = get_ssrc(ssrc_in_p->h.ssrc, h->ssrc_hash); + if (G_UNLIKELY(!next_ch)) goto next; + obj_put(&ch->h); + ch = next_ch; + atomic64_set(&ssrc_in->packets_lost, ssrc_in_p->sequencer.lost_count); atomic64_set(&ssrc_in->last_seq, ssrc_in_p->sequencer.ext_seq);