Skip to content

Commit bd86a05

Browse files
committed
avformat/tls_openssl: add check to avoid tls_shared is null
Signed-off-by: Jack Lau <[email protected]>
1 parent a0a80b6 commit bd86a05

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libavformat/tls_openssl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,8 @@ static int dtls_start(URLContext *h, const char *url, int flags, AVDictionary **
811811
{
812812
TLSContext *c = h->priv_data;
813813
TLSShared *s = &c->tls_shared;
814+
if (!s)
815+
return AVERROR(EINVAL);
814816
int ret = 0;
815817
s->is_dtls = 1;
816818

@@ -911,6 +913,8 @@ static int tls_open(URLContext *h, const char *uri, int flags, AVDictionary **op
911913
{
912914
TLSContext *c = h->priv_data;
913915
TLSShared *s = &c->tls_shared;
916+
if (!s)
917+
return AVERROR(EINVAL);
914918
int ret;
915919

916920
if ((ret = ff_tls_open_underlying(s, h, uri, options)) < 0)

0 commit comments

Comments
 (0)