---
 libavformat/tls_apple.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavformat/tls_apple.c b/libavformat/tls_apple.c
index 2ff6622565..37d63f3b27 100644
--- a/libavformat/tls_apple.c
+++ b/libavformat/tls_apple.c
@@ -165,6 +165,12 @@ static int load_identity(URLContext *h, SecIdentityRef 
*identity, CFArrayRef *ce
     if ((ret = import_pem(h, c->tls_shared.key_file, &keyArray)) < 0)
         goto end;
 
+    if (CFGetTypeID(CFArrayGetValueAtIndex(*certArray, 0)) != 
SecCertificateGetTypeID() ||
+        CFGetTypeID(CFArrayGetValueAtIndex(keyArray, 0)) != SecKeyGetTypeID()) 
{
+        ret = AVERROR_INVALIDDATA;
+        goto end;
+    }
+
     if (!(*identity = SecIdentityCreate(kCFAllocatorDefault,
                                  
(SecCertificateRef)CFArrayGetValueAtIndex(*certArray, 0),
                                  (SecKeyRef)CFArrayGetValueAtIndex(keyArray, 
0)))) {
-- 
2.21.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to