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

Michael Niedermayer michael at niedermayer.cc
Sun Jul 31 19:33:53 EEST 2016


On Tue, Jul 26, 2016 at 10:31:29AM -0700, Michael Bradshaw wrote:
> 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.

>  matroskaenc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 9c3f19e3c98788b5a9a8dda53a981c6bbe73b80a  0001-avformat-matroskaenc-fix-Voids-with-size-10.patch
> From d72405b05feabdf51284588c2734cf97dc66ae8a Mon Sep 17 00:00:00 2001
> From: Michael Bradshaw <mjbshaw at google.com>
> Date: Tue, 26 Jul 2016 10:18:43 -0700
> Subject: [PATCH] avformat/matroskaenc: fix Voids with size < 10

applied

if you want to create a fate test for this, that is welcome

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is what and why we do it that matters, not just one of them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160731/d12c42d4/attachment.sig>


More information about the ffmpeg-devel mailing list