]> git.sesse.net Git - ffmpeg/commit
avformat/matroskaenc: Check for failure when writing SeekHead
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 29 Dec 2019 08:57:44 +0000 (09:57 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 30 Mar 2020 03:25:11 +0000 (05:25 +0200)
commit8c89fc18e6125ae0449091d82a2fe200ed848c43
treefacf0a1fad84fdb60ab4bd7a5ebd44f784baaaf0
parente6ea75a38de192c3133b9eebe603979bffeed20b
avformat/matroskaenc: Check for failure when writing SeekHead

mkv_write_seekhead() would up until now try to seek to the position where
the SeekHead ought to be written, write the SeekHead and seek back. The
first of these seeks was checked as was writing, yet the seek back was
unchecked. Moreover the return value of mkv_write_seekhead() was unchecked
(the ordinary return value was the position where the SeekHead was written).

This commit changes this: Everything is checked. In the unseekable case
(where the first seek may nevertheless work when it happens in the buffer)
a failure at the first seek is not considered an error. In any case,
failure to seek back is an error.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/matroskaenc.c