On Mon, 14 Jan 2013, Diego Biurrun wrote:

On Mon, Jan 14, 2013 at 08:12:42PM +0200, Martin Storsjö wrote:

--- /dev/null
+++ b/libavformat/srtp.c
@@ -0,0 +1,291 @@
+
+void ff_srtp_free(struct SRTPContext *s)
+{
+    av_freep(&s->aes);
+    if (s->hmac)
+        av_hmac_free(s->hmac);
+    s->hmac = NULL;
+}

This does not digest NULL, maybe it's better to check for NULL,
free()-type functions usually cope well with NULL arguments..

Fixed locally

+    // MKI and lifetime not handled yet
+    s->aes = av_aes_alloc();
+    s->hmac = av_hmac_alloc(AV_HMAC_SHA1);

align

Done

+    } else {
+        s->seq_initialized = 1;
+        s->seq_largest = seq_largest;
+        s->roc = roc;

align

Done

--- /dev/null
+++ b/libavformat/srtp.h
@@ -0,0 +1,50 @@
+
+#ifndef AVFORMAT_SRTP_H
+#define AVFORMAT_SRTP_H
+
+struct SRTPContext {
+    struct AVAES *aes;
+    struct AVHMAC *hmac;
+    int hmac_size;
+    uint8_t master_key[16];
+    uint8_t master_salt[14];
+    uint8_t rtp_key[16],  rtcp_key[16];
+    uint8_t rtp_salt[14], rtcp_salt[14];
+    uint8_t rtp_auth[20], rtcp_auth[20];
+    int seq_largest, seq_initialized;
+    uint32_t roc;
+
+    uint32_t rtcp_index;
+};

This is missing a stdint.h #include and should not pass "make check".

Indeed, thanks.

All these fixed locally.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to