]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/sapdec.c
avformat/tls_schannel: always decrypt all received data
[ffmpeg] / libavformat / sapdec.c
index 7a6c8bf1761e57bde4181739aca1cccb5a84d9fd..b3644b436b51c0f6e7f42606a33898b2257d96bd 100644 (file)
@@ -42,7 +42,7 @@ struct SAPState {
     int eof;
 };
 
-static int sap_probe(AVProbeData *p)
+static int sap_probe(const AVProbeData *p)
 {
     if (av_strstart(p->filename, "sap:", NULL))
         return AVPROBE_SCORE_MAX;
@@ -68,7 +68,7 @@ static int sap_read_header(AVFormatContext *s)
     uint8_t recvbuf[RTP_MAX_PACKET_LENGTH];
     int port;
     int ret, i;
-    AVInputFormat* infmt;
+    ff_const59 AVInputFormat* infmt;
 
     if (!ff_network_init())
         return AVERROR(EIO);
@@ -142,6 +142,10 @@ static int sap_read_header(AVFormatContext *s)
         }
 
         sap->sdp = av_strdup(&recvbuf[pos]);
+        if (!sap->sdp) {
+            ret = AVERROR(ENOMEM);
+            goto fail;
+        }
         break;
     }
 
@@ -221,7 +225,6 @@ static int sap_fetch_packet(AVFormatContext *s, AVPacket *pkt)
             int i = s->nb_streams;
             AVStream *st = avformat_new_stream(s, NULL);
             if (!st) {
-                av_packet_unref(pkt);
                 return AVERROR(ENOMEM);
             }
             st->id = i;