aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/sdp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-14 22:24:03 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-14 22:32:46 +0100
commit09c13ff7bdbc9cb6e1e33aae6c61b53ef0d426b7 (patch)
treea45509a19e52355e0d290d66d3b9c8629af67caa /libavformat/sdp.c
parent6659364d3a4778b37421e35c10d9205343f0fa8d (diff)
parent6451c8853a07ff2e28bda950fb5e83fcf88c5cf4 (diff)
downloadffmpeg-09c13ff7bdbc9cb6e1e33aae6c61b53ef0d426b7.tar.gz
Merge commit '6451c8853a07ff2e28bda950fb5e83fcf88c5cf4'
* commit '6451c8853a07ff2e28bda950fb5e83fcf88c5cf4': sdp: Check theora colorspace before producing the configuration string See: db8a53d86a71c948bd41dd12d1ff1d3351ec2746 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/sdp.c')
-rw-r--r--libavformat/sdp.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index f844e4df5a..55ea0d9ee3 100644
--- a/libavformat/sdp.c
+++ b/libavformat/sdp.c
@@ -513,13 +513,6 @@ static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c,
break;
case AV_CODEC_ID_THEORA: {
const char *pix_fmt;
- if (c->extradata_size)
- config = xiph_extradata2config(c);
- else
- av_log(c, AV_LOG_ERROR, "Theora configuation info missing\n");
- if (!config)
- return NULL;
-
switch (c->pix_fmt) {
case AV_PIX_FMT_YUV420P:
pix_fmt = "YCbCr-4:2:0";
@@ -532,10 +525,16 @@ static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c,
break;
default:
av_log(c, AV_LOG_ERROR, "Unsupported pixel format.\n");
- av_free(config);
return NULL;
}
+ if (c->extradata_size)
+ config = xiph_extradata2config(c);
+ else
+ av_log(c, AV_LOG_ERROR, "Theora configuation info missing\n");
+ if (!config)
+ return NULL;
+
av_strlcatf(buff, size, "a=rtpmap:%d theora/90000\r\n"
"a=fmtp:%d delivery-method=inline; "
"width=%d; height=%d; sampling=%s; "