Commit 1ce062ab authored by Henrik Gramner's avatar Henrik Gramner

matroska: mk_close: Check fseek() return value

parent de7af918
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment