aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2012-04-29 00:08:36 +0200
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2012-04-29 13:03:15 +0200
commit755667eebc0b6303814faadef047870071ccb5c6 (patch)
tree1b0bf9c386af7cf027c9cc86e98a06abf8b64f4c /libavformat
parent370211f4702f0b26c06bfe078c4a4da9493d1161 (diff)
downloadffmpeg-755667eebc0b6303814faadef047870071ccb5c6.tar.gz
rmenc: more than 2 streams are not currently possible.
It is possible that just extending the RMMuxContext.streams array would avoid it. It is also possible that two audio streams will fail to mux correctly as well, though at least it should not crash for this reason. I do not feel like checking either of these. This patch fixes trac issue #1022 (at least it makes it exit with a proper error message instead of crashing). Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/rmenc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/rmenc.c b/libavformat/rmenc.c
index 8a9d84017a..3919ee9219 100644
--- a/libavformat/rmenc.c
+++ b/libavformat/rmenc.c
@@ -309,6 +309,11 @@ static int rm_write_header(AVFormatContext *s)
int n;
AVCodecContext *codec;
+ if (s->nb_streams > 2) {
+ av_log(s, AV_LOG_ERROR, "At most 2 streams are currently supported for muxing in RM\n");
+ return AVERROR_PATCHWELCOME;
+ }
+
for(n=0;n<s->nb_streams;n++) {
s->streams[n]->id = n;
codec = s->streams[n]->codec;