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).
Unified · Split
| @@ -309,6 +309,11 @@ static int rm_write_header(AVFormatContext *s) · 308 unmodified lines | |||
| 309 | int n; | 309 | int n; |
| 310 | AVCodecContext *codec; | 310 | AVCodecContext *codec; |
| 311 | 311 | ||
| 312 | if (s->nb_streams > 2) { | ||
| 313 | av_log(s, AV_LOG_ERROR, "At most 2 streams are currently supported for muxing in RM\n"); | ||
| 314 | return AVERROR_PATCHWELCOME; | ||
| 315 | } | ||
| 316 | |||
| 312 | for(n=0;n<s->nb_streams;n++) { | 317 | for(n=0;n<s->nb_streams;n++) { |
| 313 | s->streams[n]->id = n; | 318 | s->streams[n]->id = n; |
| 314 | codec = s->streams[n]->codec; | 319 | codec = s->streams[n]->codec; |