ffmpeg: Don't try and write sdp info if none of the outputs had an rtp format.
authorSimon Thelen <ffmpeg-dev@c-14.de>
Mon, 2 Nov 2015 15:36:16 +0000 (16:36 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 19 Nov 2015 02:51:39 +0000 (03:51 +0100)
Fixes a segfault when trying to write nonexistent rtp information.

Signed-off-by: Simon Thelen <ffmpeg-dev@c-14.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 70fb5eadc580a82c4b977a1233d70ad0041faba0)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
ffmpeg.c

index b0cf429..8fb26c2 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2337,6 +2337,9 @@ static void print_sdp(void)
         }
     }
 
+    if (!j)
+        goto fail;
+
     av_sdp_create(avc, j, sdp, sizeof(sdp));
 
     if (!sdp_filename) {
@@ -2352,6 +2355,7 @@ static void print_sdp(void)
         }
     }
 
+fail:
     av_freep(&avc);
 }