diff options
author | Tomas Härdin <Tomas.hardin@codemill.se> | 2010-01-13 14:32:48 +0000 |
---|---|---|
committer | Benoit Fouet <benoit.fouet@free.fr> | 2010-01-13 14:32:48 +0000 |
commit | 094a63f1f6ac6db79e72a10e3bbcff71185e85b9 (patch) | |
tree | ecaa564966f8a32c8948797537b112ad94904da9 /libavformat/utils.c | |
parent | ef5e7fb253de2a618ad970e9c838bbc3bb6fc03b (diff) | |
download | ffmpeg-094a63f1f6ac6db79e72a10e3bbcff71185e85b9.tar.gz |
Check there is a stream before writing header.
Patch by Tomas Härdin: $(name) punto hardin chez codemill dot se
Originally committed as revision 21186 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index b903337d34..000ab9050e 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2501,6 +2501,11 @@ int av_write_header(AVFormatContext *s) AVStream *st; // some sanity checks + if (s->nb_streams == 0) { + av_log(s, AV_LOG_ERROR, "no streams\n"); + return -1; + } + for(i=0;i<s->nb_streams;i++) { st = s->streams[i]; |