]> granicus.if.org Git - libvpx/commitdiff
vpxenc: open output file after setting pass #
authorJames Zern <jzern@google.com>
Thu, 15 Aug 2013 01:28:42 +0000 (18:28 -0700)
committerJames Zern <jzern@google.com>
Thu, 15 Aug 2013 01:34:44 +0000 (18:34 -0700)
write_ivf_file_header would incorrectly skip writing the file header in
the 2nd pass, causing the initial frame header to be overwritten on
close potential causing an overly large frame header to be read and a
crash.

most likely broken since:
9e50ed7 vpxenc: initial implementation of multistream support

fixes issue #585

Change-Id: I7e863e295dd6344c33b3e9c07f9f0394ec496e7b

vpxenc.c

index 547b5722f60efdf5c5c591998698648f44398d00..244ae073f13ff22e6aa0cdea53f7cf667c326c5f 100644 (file)
--- a/vpxenc.c
+++ b/vpxenc.c
@@ -2631,8 +2631,8 @@ int main(int argc, const char **argv_) {
                                          &global.framerate));
     }
 
-    FOREACH_STREAM(open_output_file(stream, &global));
     FOREACH_STREAM(setup_pass(stream, &global, pass));
+    FOREACH_STREAM(open_output_file(stream, &global));
     FOREACH_STREAM(initialize_encoder(stream, &global));
 
     frame_avail = 1;