]> git.sesse.net Git - ffmpeg/commitdiff
ffmpeg: move a local variable definition later.
authorNicolas George <nicolas.george@normalesup.org>
Mon, 6 May 2013 21:51:27 +0000 (23:51 +0200)
committerNicolas George <nicolas.george@normalesup.org>
Tue, 7 May 2013 16:39:45 +0000 (18:39 +0200)
Fix a segfault when using the -map option without input files.

ffmpeg_opt.c

index ff80c8ab443fd76fc21a867778cfcdb37f7a4dc6..c87bf0110064e872ba63a1f42b452b97c7743555 100644 (file)
@@ -1719,7 +1719,6 @@ static int open_output_file(OptionsContext *o, const char *filename)
     } else {
         for (i = 0; i < o->nb_stream_maps; i++) {
             StreamMap *map = &o->stream_maps[i];
-            int src_idx = input_files[map->file_index]->ist_index + map->stream_index;
 
             if (map->disabled)
                 continue;
@@ -1747,6 +1746,8 @@ loop_end:
                 }
                 init_output_filter(ofilter, o, oc);
             } else {
+                int src_idx = input_files[map->file_index]->ist_index + map->stream_index;
+
                 ist = input_streams[input_files[map->file_index]->ist_index + map->stream_index];
                 if(o->subtitle_disable && ist->st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE)
                     continue;