]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtp.c
Do not call parse_keyframes_index with NULL stream.
[ffmpeg] / libavformat / rtp.c
index d85b1b79dba76df7db19c1d1514b6f880aff4d9c..98d96160dbc3654057966860c27ba2689610dd45 100644 (file)
@@ -98,7 +98,8 @@ int ff_rtp_get_payload_type(AVFormatContext *fmt, AVCodecContext *codec)
     /* Was the payload type already specified for the RTP muxer? */
     if (ofmt && ofmt->priv_class) {
         int64_t payload_type;
-        if (av_opt_get_int(fmt->priv_data, "payload_type", 0, &payload_type) >= 0)
+        if (av_opt_get_int(fmt->priv_data, "payload_type", 0, &payload_type) >= 0 &&
+            payload_type >= 0)
             return (int)payload_type;
     }