[x264-devel] matroska: mk_close: Check fseek() return value

Henrik Gramner git at videolan.org
Tue Apr 12 20:36:14 CEST 2016


x264 | branch: master | Henrik Gramner <henrik at gramner.com> | Fri Feb  5 18:46:13 2016 +0100| [1ce062abb47ac59621b402cb26a1f14c91bb52bc] | committer: Henrik Gramner

matroska: mk_close: Check fseek() return value

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=1ce062abb47ac59621b402cb26a1f14c91bb52bc
---

 output/matroska_ebml.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/output/matroska_ebml.c b/output/matroska_ebml.c
index aa2b448..6d6c760 100644
--- a/output/matroska_ebml.c
+++ b/output/matroska_ebml.c
@@ -499,10 +499,10 @@ int mk_close( mk_writer *w, int64_t last_delta )
         ret = -1;
     if( w->wrote_header && x264_is_regular_file( w->fp ) )
     {
-        fseek( w->fp, w->duration_ptr, SEEK_SET );
         int64_t last_frametime = w->def_duration ? w->def_duration : last_delta;
-        int64_t total_duration = w->max_frame_tc+last_frametime;
-        if( mk_write_float_raw( w->root, (float)((double)total_duration / w->timescale) ) < 0 ||
+        int64_t total_duration = w->max_frame_tc + last_frametime;
+        if( fseek( w->fp, w->duration_ptr, SEEK_SET ) ||
+            mk_write_float_raw( w->root, (float)((double)total_duration / w->timescale) ) < 0 ||
             mk_flush_context_data( w->root ) < 0 )
             ret = -1;
     }



More information about the x264-devel mailing list