X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fsdp.c;h=1200e553f98c8b55a027f2e509bf5555622f7807;hb=3749eede66c3774799766b1f246afae8a6ffc9bb;hp=a5d202e99cb28473194e15fd7ce9a5476feb44ec;hpb=73d193d1d0ff62a029a905d1404c0fd357f4c880;p=ffmpeg diff --git a/libavformat/sdp.c b/libavformat/sdp.c index a5d202e99cb..1200e553f98 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -212,7 +212,7 @@ static char *extradata2psets(AVFormatContext *s, AVCodecParameters *par) p += strlen(p); r = r1; } - if (sps && sps_end - sps >= 4) { + if (sps && sps_end - sps >= 4 && p - psets <= MAX_PSET_SIZE - strlen(profile_string) - 7) { memcpy(p, profile_string, strlen(profile_string)); p += strlen(p); ff_data_to_hex(p, sps + 1, 3, 0); @@ -347,7 +347,8 @@ static char *extradata2config(AVFormatContext *s, AVCodecParameters *par) static char *xiph_extradata2config(AVFormatContext *s, AVCodecParameters *par) { - char *config, *encoded_config; + uint8_t *config; + char *encoded_config; const uint8_t *header_start[3]; int headers_len, header_len[3], config_len; int first_header_size; @@ -703,20 +704,6 @@ static char *sdp_write_media_attributes(char *buff, int size, AVStream *st, int case AV_CODEC_ID_SPEEX: av_strlcatf(buff, size, "a=rtpmap:%d speex/%d\r\n", payload_type, p->sample_rate); - if (st->codec) { - const char *mode; - uint64_t vad_option; - - if (st->codec->flags & AV_CODEC_FLAG_QSCALE) - mode = "on"; - else if (!av_opt_get_int(st->codec, "vad", AV_OPT_FLAG_ENCODING_PARAM, &vad_option) && vad_option) - mode = "vad"; - else - mode = "off"; - - av_strlcatf(buff, size, "a=fmtp:%d vbr=%s\r\n", - payload_type, mode); - } break; case AV_CODEC_ID_OPUS: /* The opus RTP draft says that all opus streams MUST be declared