[FFmpeg-devel] [PATCH] avformat/matroskaenc: fix Voids with size < 10

Michael Bradshaw mjbshaw at gmail.com
Tue Jul 26 20:31:29 EEST 2016


Hi,

Attached patch fixes the MKV muxer when trying to write Void elements that
have a size < 10. The current code subtracts 1 from the size, which
accounts for the element ID byte, but it doesn't account for the additional
size byte. This causes the Void element to take up 1 more byte than
intended, which will corrupt the file.

A simple example to reproduce the issue:

$ ffmpeg -f lavfi -i testsrc -vframes 1 -reserve_index_space 38 test.webm
$ mkvinfo test.webm
[...]
test.webm: Error in the Matroska file structure at position 479. Resyncing
to the next level 1 element.
Resync failed: no valid Matroska level 1 element found.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-avformat-matroskaenc-fix-Voids-with-size-10.patch
Type: application/octet-stream
Size: 877 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160726/e0d2f86d/attachment.obj>


More information about the ffmpeg-devel mailing list