aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPascal Bühler <pabuhler@cisco.com>2019-04-29 09:51:30 +0200
committerGitHub <noreply@github.com>2019-04-29 09:51:30 +0200
commit2b270e49881633a16095d94d80b8df97647bbeb8 (patch)
treeee8a812eeee1d284dd381880f48a57c30c741bf8
parenta43393dffb1aaa1d5a9e80b65689e2d65fc436b5 (diff)
parent304e3cb9803b74a8fef78128c87e9b99714b8340 (diff)
downloadlibsrtp2-2b270e49881633a16095d94d80b8df97647bbeb8.tar.gz
Merge pull request #443 from pabuhler/rtp-decoder-crash
rtp_decoder avoid crash when no packets found
-rw-r--r--test/rtp_decoder.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/rtp_decoder.c b/test/rtp_decoder.c
index 934d0c5..3b017b9 100644
--- a/test/rtp_decoder.c
+++ b/test/rtp_decoder.c
@@ -615,7 +615,10 @@ srtp_err_status_t rtp_decoder_init_srtp(rtp_decoder_t decoder,
int rtp_decoder_deinit_srtp(rtp_decoder_t decoder)
{
- return srtp_dealloc(decoder->srtp_ctx);
+ if (decoder->srtp_ctx) {
+ return srtp_dealloc(decoder->srtp_ctx);
+ }
+ return 0;
}
int rtp_decoder_init(rtp_decoder_t dcdr, srtp_policy_t policy)