OSDN Git Service

matroskadec: add generic element length validation.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sun, 6 Feb 2011 10:32:03 +0000 (11:32 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 9 Feb 2011 02:31:17 +0000 (03:31 +0100)
commit14d735bd4f7c1dda547d4a4bd3de31536ef11a2a
tree13aa9d5947b791b3a27b8d37936c88482b305836
parentcb9f7fd34c07de6bceb1fb03057f5f0fe42ca0e8
matroskadec: add generic element length validation.

This validate the length of a mkv element directly after reading
it.
This has the advantage that it is easy to add new limits and makes
it less likely to forget to add checks and also avoids issues like
bits of the length value above the first 32 being ignored because
the parsing functions only takes an int.
Previously discussed in the "mkv 0-byte integer parsing" thread.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit 95ec3d4cacd084e2448c3a1aba420e7d8f00e19b)
libavformat/matroskadec.c