From 4f90688b6e1d79d85ac2e065a2cf1e7e9bd665a7 Mon Sep 17 00:00:00 2001 From: Aurelien Jacobs Date: Tue, 17 Aug 2010 14:05:23 +0000 Subject: [PATCH] matroskadec: fix integer overflow patch from reimar Originally committed as revision 24803 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/matroskadec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 60f03ce362..ab5e1d13cf 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -901,6 +901,9 @@ static int matroska_decode_buffer(uint8_t** buf, int* buf_size, int result = 0; int olen; + if (pkt_size >= 10000000) + return -1; + switch (encodings[0].compression.algo) { case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP: return encodings[0].compression.settings.size;