OSDN Git Service

rtp: Don't read priv_data unless it is allocated
authorMartin Storsjö <martin@martin.st>
Thu, 20 Dec 2012 11:53:27 +0000 (13:53 +0200)
committerMartin Storsjö <martin@martin.st>
Thu, 20 Dec 2012 12:25:49 +0000 (14:25 +0200)
This makes all users of rtpenc_chain (rtsp muxer, sapenc, mov
rtp hinting) work again, broken since 8034130e0.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/rtp.c

index 6512206..38b2348 100644 (file)
@@ -97,7 +97,7 @@ int ff_rtp_get_payload_type(AVFormatContext *fmt,
     AVOutputFormat *ofmt = fmt ? fmt->oformat : NULL;
 
     /* Was the payload type already specified for the RTP muxer? */
-    if (ofmt && ofmt->priv_class) {
+    if (ofmt && ofmt->priv_class && fmt->priv_data) {
         int64_t payload_type;
         if (av_opt_get_int(fmt->priv_data, "payload_type", 0, &payload_type) >= 0 &&
             payload_type >= 0)