changeset 5528:9cc93fd4bb72 libavformat

Check there is a stream before writing header. Patch by Tomas H¸«£rdin: $(name) punto hardin chez codemill dot se
author benoit
date Wed, 13 Jan 2010 14:32:48 +0000
parents 2d0a0d3e5df1
children 0a67dbb939a0
files utils.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Tue Jan 12 16:36:23 2010 +0000
+++ b/utils.c	Wed Jan 13 14:32:48 2010 +0000
@@ -2501,6 +2501,11 @@
     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];